An opinionated, minimal cookiecutter template for Python packages, and some guidelines for Python packaging.
pip install cookiecutter
git clone https://github.com/kragniz/cookiecutter-pypackage-minimal.git
cookiecutter cookiecutter-pypackage-minimal/
You should then change the classifiers in {{ package_name }}/setup.py
- it is assumed that the project will run on the latest versions of Python 2 and 3, so you should remove any classifiers that do not apply. The full list of PyPI classifiers can be found here.
Fill out the README, and - if necessary - choose a license for the project.
The decisions cookiecutter-pypackage-minimal
makes should all be explained here.
{{ package_name }}/setup.py
file:
adjust the classifiers
and license
fields accordingly.{{ package_name }}/setup.py
file, set license="Proprietary"
, and choose 'License :: Other/Proprietary License'
in the trove classifiers.setup.py
distribute
has merged back into setuptools
, and distutils
is less capable.ImportError
.requirements.txt
file). See the testing section below for testing dependencies.tox.ini
Avoid duplicating dependency definitions, and use tox.ini
as the canonical description of how the unittests should be run.tests
directory should not be a package
The tests
directory should not be a Python package unless you want to define some fixtures.
But the best practices are to use PyTest fixtures which provides a better solution.
Therefore, the tests
directory has no __init__.py
file.