2016-10-18 01:00:14 +08:00
|
|
|
This directory contains the code for the Python `brotli` module,
|
|
|
|
`bro.py` tool, and roundtrip tests.
|
2016-02-23 23:06:31 +08:00
|
|
|
|
2017-08-02 22:59:46 +08:00
|
|
|
We provide a `Makefile` to simplify common development commands.
|
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
### Installation
|
2016-02-23 23:06:31 +08:00
|
|
|
|
2017-08-02 22:59:46 +08:00
|
|
|
If you just want to install the latest release of the Python `brotli`
|
|
|
|
module, we recommend installing from [PyPI][]:
|
|
|
|
|
|
|
|
$ pip install brotli
|
|
|
|
|
|
|
|
Alternatively, you may install directly from source by running the
|
|
|
|
following command from this directory:
|
2016-12-21 17:17:11 +08:00
|
|
|
|
2017-08-02 22:59:46 +08:00
|
|
|
$ make install
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
### Development
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
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.
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2017-08-02 22:59:46 +08:00
|
|
|
For convenience, you may run the following commands from this directory:
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
$ make # Deploy the module in "development mode"
|
|
|
|
|
|
|
|
$ make tests # Test the module
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
$ make clean # Remove all temporary files and build output
|
2016-10-18 01:00:14 +08:00
|
|
|
|
|
|
|
### Code Style
|
|
|
|
|
|
|
|
Brotli's code follows the [Google Python Style Guide][]. To
|
2016-12-21 17:17:11 +08:00
|
|
|
automatically format your code, first install [YAPF][]:
|
2016-10-18 01:00:14 +08:00
|
|
|
|
|
|
|
$ pip install yapf
|
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
Then, to format all files in the project, you can run:
|
2016-10-18 01:00:14 +08:00
|
|
|
|
2016-12-21 17:17:11 +08:00
|
|
|
$ make fix # Automatically format code
|
2016-10-18 01:00:14 +08:00
|
|
|
|
|
|
|
See the [YAPF usage][] documentation for more information.
|
|
|
|
|
|
|
|
|
2017-08-02 22:59:46 +08:00
|
|
|
[PyPI]: https://pypi.org/project/Brotli/
|
2016-12-21 17:17:11 +08:00
|
|
|
[development mode]: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
|
2016-10-18 01:00:14 +08:00
|
|
|
[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
|