Getting started¶
Working on packaging requires the installation of a small number of
development dependencies. To see what dependencies are required to
run the tests manually, please look at the tox.ini
file.
Running tests¶
The packaging unit tests are found in the tests/
directory and are
designed to be run using pytest. pytest will discover the tests
automatically, so all you have to do is:
$ python -m pytest
...
62746 passed in 220.43 seconds
This runs the tests with the default Python interpreter. This also allows you to run select tests instead of the entire test suite.
You can also verify that the tests pass on other supported Python interpreters. For this we use tox, which will automatically create a virtualenv for each supported Python version and run the tests. For example:
$ tox
...
py27: commands succeeded
ERROR: pypy: InterpreterNotFound: pypy
ERROR: py34: InterpreterNotFound: python3.4
ERROR: py35: InterpreterNotFound: python3.5
py36: commands succeeded
ERROR: py37: InterpreterNotFound: python3.7
docs: commands succeeded
pep8: commands succeeded
You may not have all the required Python versions installed, in which case you
will see one or more InterpreterNotFound
errors.
If you wish to run just the linting rules, you may use pre-commit.
Building documentation¶
packaging documentation is stored in the docs/
directory. It is
written in reStructured Text and rendered using Sphinx.
Use tox to build the documentation. For example:
$ tox -e docs
...
docs: commands succeeded
congratulations :)
The HTML documentation index can now be found at
docs/_build/html/index.html
.