diff options
author | Alex Nicksay <nicksay@google.com> | 2016-12-21 04:17:11 -0500 |
---|---|---|
committer | Eugene Kliuchnikov <eustas@google.com> | 2016-12-21 10:17:11 +0100 |
commit | 6ab0a5cee7a36b30012066caf6bca9a48fcae958 (patch) | |
tree | 23ae6ea4ace6e754de6629a2f3e65c2f7a7ae762 /python/README.md | |
parent | fd96151b2a04667dac73242b72bc62e007b2b543 (diff) | |
download | brotli-6ab0a5cee7a36b30012066caf6bca9a48fcae958.zip brotli-6ab0a5cee7a36b30012066caf6bca9a48fcae958.tar.gz brotli-6ab0a5cee7a36b30012066caf6bca9a48fcae958.tar.bz2 |
Python: Create Makefile for development shortcuts (#488)
Diffstat (limited to 'python/README.md')
-rw-r--r-- | python/README.md | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/python/README.md b/python/README.md index 6f5ce24..60ed84b 100644 --- a/python/README.md +++ b/python/README.md @@ -1,38 +1,43 @@ This directory contains the code for the Python `brotli` module, `bro.py` tool, and roundtrip tests. +### Installation -### Development +If you just want to install the module from source, execute the +following from the root project directory: + + $ python setup.py install -To build the module, execute the following from the root project -directory: +### Development - $ python setup.py build +For development, reinstalling the module with every change is time +consuming. Instead, we recommend using the `setuptools` +"[development mode][]" to make the module available while still being +able to edit the source files. -To test the module, execute the following from the root project -directory: +We provide a `Makefile` to simplify common commands: - $ python setup.py test + $ make # Deploy the module in "development mode" + + $ make tests # Test the module + $ make clean # Remove all temporary files and build output ### Code Style Brotli's code follows the [Google Python Style Guide][]. To -automatically format your code, install [YAPF][]: +automatically format your code, first install [YAPF][]: $ pip install yapf -Then, either format a single file: - - $ yapf --in-place FILE - -Or, format all files in a directory: +Then, to format all files in the project, you can run: - $ yapf --in-place --recursive DIR + $ make fix # Automatically format code See the [YAPF usage][] documentation for more information. +[development mode]: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode [Google Python Style Guide]: https://google.github.io/styleguide/pyguide.html [YAPF]: https://github.com/google/yapf [YAPF usage]: https://github.com/google/yapf#usage |