A modern package template for Cookiecutter, targetting Python 3.
- Task running using Invoke, instead of a Makefile.
- PyPI registration and deployment using Twine.
- Linting using Coala as a unified interface to multiple linters, including Pylint.
- (Optional) support for type-checking with Mypy
- Ensure cookiecutter is installed:
pip install cookiecutter
- Create the package structure:
cookiecutter https://github.com/kdelwat/cookiecutter-pymodern
- Move into the package:
cd your_package_name
- Create a virtual environment for the project
using virtualenv
or virtualenvwrapper
(recommended):
mkvirtualenv your_package_name
- Install the development requirements:
pip install -r requirements-dev.txt
Usage tasks are run using the invoke
command. The following tasks are available
for general use:
clean
: Clean build and distribution files, including.pyc
compiled files.build
: Build the package.lint
: Run Coala to lint the package with default settings.
cookiecutter-pymodern
can deploy to PyPi
using twine.
-
Ensure you have a
.pypirc
file in your home directory, configured with your username and password. A minimal example from the Python packaging guidelines is:[distutils] index-servers=pypi [pypi] repository = https://upload.pypi.org/legacy/ username = <username> password = <password>
-
Build and register the package:
invoke register
. -
Build and deploy new versions with:
invoke deploy