aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Nicksay <nicksay@google.com>2017-08-02 10:59:46 -0400
committerEugene Kliuchnikov <eustas@google.com>2017-08-02 16:59:46 +0200
commit06082531107d666ba44bb4dc341970a0916ef587 (patch)
tree66279b0392bca2ae73fc5160c73665f0758324a8
parentbc541f74e11af3ae36606d7439c99c62c80afa0c (diff)
downloadbrotli-06082531107d666ba44bb4dc341970a0916ef587.zip
brotli-06082531107d666ba44bb4dc341970a0916ef587.tar.gz
brotli-06082531107d666ba44bb4dc341970a0916ef587.tar.bz2
Python: Add a "make install" command and clarify installation docs (#578)
Closes #576
-rw-r--r--README.md8
-rw-r--r--python/Makefile7
-rw-r--r--python/README.md16
3 files changed, 22 insertions, 9 deletions
diff --git a/README.md b/README.md
index b092e4f..c59d361 100644
--- a/README.md
+++ b/README.md
@@ -66,12 +66,12 @@ See [Premake5](https://premake.github.io/)
#### Python
-To install the Python module from source, run the following:
+To install the latest release of the Python module, run the following:
- $ python setup.py install
+ $ pip install brotli
-See the [Python readme](python/README.md) for more details on testing
-and development.
+See the [Python readme](python/README.md) for more details on installing
+from source, development, and testing.
### Benchmarks
* [Squash Compression Benchmark](https://quixdb.github.io/squash-benchmark/) / [Unstable Squash Compression Benchmark](https://quixdb.github.io/squash-benchmark/unstable/)
diff --git a/python/Makefile b/python/Makefile
index cdf3aac..646f330 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -4,10 +4,12 @@
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
-# Default
+# Default (Build)
.PHONY: all
# Build
.PHONY: build
+# Install
+.PHONY: install
# Test
.PHONY: test tests
# Clean
@@ -31,6 +33,9 @@ build: $(EXTENSIONS)
$(EXTENSIONS): $(EXT_SOURCES)
@cd .. && $(PYTHON) setup.py develop
+install:
+ @cd .. && $(PYTHON) setup.py install
+
test: tests
tests: build
diff --git a/python/README.md b/python/README.md
index 60ed84b..33cba56 100644
--- a/python/README.md
+++ b/python/README.md
@@ -1,12 +1,19 @@
This directory contains the code for the Python `brotli` module,
`bro.py` tool, and roundtrip tests.
+We provide a `Makefile` to simplify common development commands.
+
### Installation
-If you just want to install the module from source, execute the
-following from the root project directory:
+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:
- $ python setup.py install
+ $ make install
### Development
@@ -15,7 +22,7 @@ consuming. Instead, we recommend using the `setuptools`
"[development mode][]" to make the module available while still being
able to edit the source files.
-We provide a `Makefile` to simplify common commands:
+For convenience, you may run the following commands from this directory:
$ make # Deploy the module in "development mode"
@@ -37,6 +44,7 @@ Then, to format all files in the project, you can run:
See the [YAPF usage][] documentation for more information.
+[PyPI]: https://pypi.org/project/Brotli/
[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