Getting Started: Contributing to the Template¶
This section is for contributors looking to work on the cookiecutter-robust-python template source code itself. If you are using a project generated by the template, please refer to the documentation within your generated project’s docs/ directory (typically accessible via uvx nox -s docs in your project root, or via the project’s online documentation).
Prerequisites¶
To contribute to the template, you will need:
Git: For version control.
Python 3.10+: We recommend using a supported Python version.
uv: Our chosen dependency manager (see Dependency Management (02)). Install
uvglobally or in a base environment following the official uv installation guide.Docker or Podman: Required for testing the containerization aspects of the generated template (see Container Build (11), Dev Containers (17)).
Task Automation Tools: The template uses
noxfile.pyfor development workflows. We useuvxto runnoxso that it automatically installs if needed.
Setting up Your Development Environment¶
Clone the Template Repository:
git clone https://github.com/robust-python/cookiecutter-robust-python.git cd cookiecutter-robust-python
Install Template Development Dependencies: Install all dependency groups needed for template development:
uv sync --all-groups
Install Pre-commit Hooks for the Template: Set up pre-commit hooks to maintain code quality:
uvx nox -s pre-commit -- install
Set up Dev Container (Optional): If you use VS Code and Docker/Podman, you can open the template repository in a Dev Container for a consistent environment for working on the template. (Add instructions here if the template source also has a
.devcontainerconfig).
Running Template Checks and Builds¶
The template’s own noxfile.py defines tasks for maintaining the template itself.
List Available Tasks:
uvx nox -l
Run Core Template Checks: Lint and format the template’s own Python files:
uvx nox -s lint
Build Template Documentation: This builds the documentation you are currently reading.
uvx nox -s docs # Builds the template's sphinx documentation
Run Template Tests: Test the template’s generation functionality:
uvx nox -s test
Generate Demo Project: Create a demo project to test template functionality:
uvx nox -s generate-demo
Updating Template Version and Releasing¶
This template uses Calendar Versioning (YYYY.MM.DD) for its own releases.
Ensure Your Branch is Up-to-date: Pull the latest changes from the main branch.
Release the Template:
uvx nox -s release-template # Uses Commitizen to bump version and create tags
This will update the version string(s) (e.g., in
__version__.pyorconf.py), create a Git tag, and potentially update the changelog.Push Changes and Tags: Push the commits and the newly created tag to the template repository:
git push origin HEAD --tags
This pushed tag may trigger CI/CD for the template itself (e.g., building and deploying the template documentation, maybe running tests on the template’s functionality).
How to Contribute¶
(Add detailed guidelines on submitting Pull Requests, coding standards for template source code, communication channels, etc. Link to CONTRIBUTING.md if available).