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:

  1. Git: For version control.

  2. Python 3.10+: We recommend using a supported Python version.

  3. uv: Our chosen dependency manager (see Dependency Management (02)). Install uv globally or in a base environment following the official uv installation guide.

  4. Docker or Podman: Required for testing the containerization aspects of the generated template (see Container Build (11), Dev Containers (17)).

  5. Task Automation Tools: The template uses noxfile.py for development workflows. We use uvx to run nox so that it automatically installs if needed.

Setting up Your Development Environment

  1. Clone the Template Repository:

    git clone https://github.com/robust-python/cookiecutter-robust-python.git
    cd cookiecutter-robust-python
    
  2. Install Template Development Dependencies: Install all dependency groups needed for template development:

    uv sync --all-groups
    
  3. Install Pre-commit Hooks for the Template: Set up pre-commit hooks to maintain code quality:

    uvx nox -s pre-commit -- install
    
  4. 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 .devcontainer config).

Running Template Checks and Builds

The template’s own noxfile.py defines tasks for maintaining the template itself.

  1. List Available Tasks:

    uvx nox -l
    
  2. Run Core Template Checks: Lint and format the template’s own Python files:

    uvx nox -s lint
    
  3. Build Template Documentation: This builds the documentation you are currently reading.

    uvx nox -s docs # Builds the template's sphinx documentation
    
  4. Run Template Tests: Test the template’s generation functionality:

    uvx nox -s test
    
  5. 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.

  1. Ensure Your Branch is Up-to-date: Pull the latest changes from the main branch.

  2. 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__.py or conf.py), create a Git tag, and potentially update the changelog.

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