Cookiecutter template for an Arup Python package.
This template is based on @audreyfeldroy's original cookiecutter template. It has been updated to use latest Python Package best practices and to align with Arup's City Modelling Lab Python projects.
- Testing setup with pytest.
- Markdown based documentation, using mkdocs, ready for generation with GitHub pages.
- Project metadata and plugin configuration specified in a
pyproject.toml
file, according to the latest standards. - Auto-release to your private conda channel when you create a new release on GitHub (optional).
- Command line interface using click (optional).
To be able to keep your project up-tp-date as changes are made to the template, we recommend you use Cruft, which is fully compatible with Cookiecutter. First, install the latest version of Cruft if you haven't installed it yet.
conda create -n cookiecutter cruft
conda activate cookiecutter
Generate a local Python package project in a directory of your choice (change my-repositories
to the relevant location on your device):
cd my-repositories
cruft create https://github.com/arup-group/cookiecutter-pypackage
Then:
- Add the packages you will need for your project and their versions to
requirements/base.txt
. - initialise your project as a git repository and link it to an online repository.
For more details, see the tutorial.
We may make changes to this template that you want to pull into your project after you have created it. Cruft allows you to do this, and one of your project's CI workflows will verify whether there are new template updates that you might like to merge in.
To check if there are updates:
cruft check
To apply updates:
cruft update
Don't worry, you have options:
There are currently no other Arup cookiecutter templates.
You can find a list of other Python project templates on the parent template repository: audreyfeldroy/cookiecutter-pypackage.
If you have differences in your preferred setup, you can fork this to create your own version. Or you create your own; it doesn't strictly have to be a fork.
-
Once you have your own version working, add it to the Other Arup Cookiecutter Templates list above with a brief description.
-
It's up to you whether or not to rename your fork/own version. Do whatever you think sounds good.
We also accept pull requests on this repository, if they're small!