diff --git a/.gitignore b/.gitignore index 52c5521..2206bbc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ MANIFEST build cheat.egg-info dist +venv diff --git a/README.md b/README.md index aedcfd8..0f7cd9d 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ cheat tar You will be presented with a cheatsheet resembling: ```sh -# To extract an uncompressed archive: +# To extract an uncompressed archive: tar -xvf '/path/to/foo.tar' # To extract a .gz archive: @@ -117,6 +117,27 @@ enable this feature, set a `CHEATCOLORS` environment variable: export CHEATCOLORS=true ``` +Development +----------- + +Virtual environments and `setuptools` can be used to develop `cheat`: + +Create a virtual environment with [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/): + + $ virtualenv venv + +Activate it: + + $ source venv/bin/activate + +Install `cheat` in the venv in [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode): + + $ python setup.py develop + +Now `cheat` can be run from inside the venv: + + $ venv/bin/cheat + See Also: --------- - [Enabling Command-line Autocompletion][autocompletion] diff --git a/setup.py b/setup.py index abd32c4..1e815cd 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ -from distutils.core import setup +try: + from setuptools import setup +except ImportError: + from distutils.core import setup import os setup(