Skip to content

robust-python/cookiecutter-robust-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

User Guide uv Python Versions Python demo status Maturin demo status Discord

⭐ Star us on GitHub β€” it motivates us a lot and helps to pay the rent!


cookiecutter-robust-python is a template made with the understanding that project needs change over time.

The Robust Python Cookiecutter aims to provide best practice tooling/CICD within a structure designed for future adaptability. Meaning that important decisions like whether to use maturin may be delayed without breaking the docs, CICD, etc. during transition.


Table of Contents

About

Key Features

  • Uses cruft to allow for easily transitioning between:
  • Out of the box support/testing for major OS's (windows, linux, macos) and all currently supported python versions
  • Automated template demos for integration testing generated CICD
  • Rich documentation explaining tooling decisions and rationale
  • and just about any other typical CI workflow you can think of (linting, release process, security, etc.)

Tooling Summary

  • cruft for project generation/update
  • uv for dependency management
  • nox for CI execution
  • commitizen for version/changelog management
  • ruff for linting/formatting
  • basedpyright for type checking
  • pip-audit for security vulnerability checking
  • maturin (optional) for rust integration when needed

πŸ’‘ For more information on tools evaluated and why choices were made, please visit our docs on tooling decisions


Getting Started

Prerequisites

The only requirement is installing uv.

Besides that, it may be useful to install the following to avoid uvx installing dependencies at unexpected times:

uv tool install nox
uv tool install cruft
uv tool install ruff
uv tool install basedpyright
uv tool install maturin

Usage

Navigate to where you want to create your project and run:

uvx cruft create https://github.com/robust-python/cookiecutter-robust-python

This will prompt you for a few inputs to customize your project:

[1/15] project_name (robust-python): my-awesome-project
[2/15] package_name (my_awesome_project):
[3/15] friendly_name (My Awesome Project):
...

Project Setup

After generating your project, set it up for development:

cd my-awesome-project

uvx nox -s setup-venv
uvx nox -s setup-git
gh repo create my-awesome-project
uvx nox -s setup-remote

⚠️ Scripts and nox sessions prefixed with "setup-" are usually not idempotent, although some will try to warn you if misused.

From there all that is left is setting up various integrations like Pypi publishing and Readthedocs as desired.


Roadmap

This is a really brief/condensed idea of what is planned for this template, and where it stands currently:

Click to expand
  • Swap to UV, Ruff, and Basedpyright (maybe ty later, but at the moment of writing this wasn't ready yet)
  • Add cruft and commitizen
  • Centralize CI/CD through noxfile using uv cache to maintain speed
  • Add CI/CD for GitHub, Gitlab, and Bitbucket (Only GitHub guaranteed to work, but others should be close enough)
  • Add automated integration testing with separate repos to act as demos
  • Add release process for demo
  • Ensure end to end process for base python template works fully
  • Ensure maturin template works locally
  • Add modified CI/CD for the maturin version
  • Add CI/CD for the cookiecutter itself
  • Add github actions to automate demo publishing on merge to main or develop in cookiecutter
  • Better define out templates for issues, pull requests, etc.
  • Improve generated changelogs
  • Clean up documentation and make it readable
  • Possibly swap documentation to follow MADR (Maybe during clean up process, but low priority for the time being)
  • Move to an organization (Will be done whenever there are other users besides myself)
  • Add any missing automation for administrative tasks
  • Designate backup plans for the projects lifecycle over time

Current Status

vendor Demo Statuses
github Python demo statusMaturin demo status
gitlab Python demo statusMaturin demo status
bitbucket Python demo statusMaturin demo status

Why does this project exist?

Unfortunately, the Hypermodern Python Cookiecutter is no longer maintained nor modern. While it will always have a place in my heart, there have been far too many improvements in Python tooling to keep using it as is.

For a while I maintained a personal fork that I would update, however, when it came time to switch to new tooling such as ruff, uv, maturin, etc., I found the process of updating the existing tooling to be extremely painful.

The Hypermodern Python Cookiecutter remains as a fantastic sendoff point for devs interested in building a 2021-style Python Package. However, there were a handful of issues with it that prevented it from being able to adapt to new Python developments over the years.

The goal is for cookiecutter-robust-python to fill the gap that exists for a best practices template that is structured to be adaptable from the start.


Contributing

For more information on contributing to the Robust Python Cookiecutter, please visit the contributing docs.

About

A Python template optimizing for best practices that remain adaptable over time

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors 2

  •  
  •