Setup Script

The setup.py file is a swiss knife for various tasks.

Start by creating a virtual python environment:

$ python -m venv .

You now can use this isolated clean python environment:

$ bin/python --version
Python 3.5.2

You may also activate it for the current shell. POSIX shells would use:

$ . bin/activate

running tests

We use py.test for running tests because it is amazing. Run it by invoking the simple test alias of setup.py:

$ bin/python setup.py test

This will also check codestyle and test coverage.

checking code style

We use flake8 for enforcing coding standards. Run it by invoking the simple lint alias of setup.py:

$ bin/python setup.py lint

building source distirbutions

Standard sdist is supported:

$ bin/python setup.py sdist

building binary distributions

Use the wheel distribution standard:

$ bin/python setup.py bdist_wheel

building html documentation

Use setup.py to build the documentation:

$ bin/python setup.py docs

A make implementation is not required on any platform, thanks to the setup.Documentation class.

class setup.Documentation(dist, **kw)[source]

Make the documentation (without the Make program).

Note

This command will not allow any warning from Sphinx, treating them as errors.

Construct the command for dist, updating vars(self) with any keyword parameters.

cleaning your workspace

We also included a custom command which you can invoke through setup.py:

$ bin/python setup.py clean

The setup.Clean command is set to clean the following file patterns:

class setup.Clean(dist, **kw)[source]

Custom clean command to tidy up the project.

Construct the command for dist, updating vars(self) with any keyword parameters.

default_patterns = ['build', 'dist', '*.egg-info', '*.egg', '*.pyc', '*.pyo', '*~', '__pycache__', '.tox', '.coverage', 'htmlcov']