Developer Guide¶
- Repository: github.com/andsor/pytemper
- Bibliography: www.citeulike.org/group/19419
Development environment¶
Use tox to prepare virtual environments for development.
To set up a Python 2.7 environment in .devenv27
, run:
$ tox -e devenv27
To set up a Python 3.4 environment in .devenv34
, run:
$ tox -e devenv34
Add requirements for the development environments to the requirements-dev.txt file.
Packaging¶
This package uses setuptools.
Run
$ python setup.py sdist
or
$ python setup.py bdist
to build a source or binary distribution.
Complete Git Integration¶
The package is maintained in a git repository.
The setuptools script setup.py
uses the information of tags to infer the
version of your project with the help of setuptools_scm.
To use this feature you need to tag with the format MAJOR.MINOR[.PATCH]
, e.g. 0.0.1
or 0.1
.
Run python setup.py --version
to retrieve the current PEP440-compliant version.
This version will be used when building a package and is also accessible
through simoa.__version__
.
Unleash the power of Git by using its pre-commit hooks.
Make sure pre-commit is installed, e.g. pip install pre-commit
, then just
run pre-commit install
.
Sphinx Documentation¶
This project follows the NumPy documentation style.
Build the documentation with:
$ tox -e docs
Add requirements for building the documentation to the requirements-doc.txt file.
Uploading documentation to GitHub pages¶
Run:
$ ghp-import -n -p docs/_build/html
or:
$ doit upload_doc
to upload the built HTML documentation to GitHub pages.
Continuous documentation building¶
For continuously building the documentation during development, run:
$ tox -e cdocs
Unittest & Coverage¶
Run
$ tox -e py27
or:
$ tox -e py34
to run all unittests defined in the subfolder test
with the help of tox
and py.test.
The py.test plugin pytest-cov is used to automatically generate a coverage report.
Continuous testing¶
For continuous testing in a Python 2.7 environment, run:
$ tox -e c27
For continuous testing in a Python 3.4 environment, run:
$ tox -e c34
Requirements Management¶
Add requirements to the requirements.txt file which
will be automatically used by setup.py
.
Bibliography¶
A CiteULike group manages the bibliography.
To download the bibliography, run
$ doit download_bib