Skip to content

Cookiecutter template for a City Modelling Lab Python package

License

Notifications You must be signed in to change notification settings

arup-group/cookiecutter-pypackage

Repository files navigation

Arup Cookiecutter Python Package Template

Daily CI Build Documentation

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.

Features

  • 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).

Quickstart

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.

Keeping your project up-to-date

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

Not Exactly What You Want?

Don't worry, you have options:

Other Arup Cookiecutter Templates

There are currently no other Arup cookiecutter templates.

Other Cookiecutter Templates

You can find a list of other Python project templates on the parent template repository: audreyfeldroy/cookiecutter-pypackage.

Fork This / Create Your Own

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.

Or Submit a Pull Request

We also accept pull requests on this repository, if they're small!