Skip to content

Latest commit

 

History

History
83 lines (60 loc) · 1.45 KB

development.md

File metadata and controls

83 lines (60 loc) · 1.45 KB

Development Guide

This guide covers local development setup and workflow for the Copier template project.

Prerequisites

  • Python 3.10 or newer
  • Git
  • uv (recommended) or pip/pipx

Quick Start

  1. Clone the repository:

    git clone https://github.com/patryk-gpl/copier-python-uv.git
    cd copier-python-uv
  2. Install dependencies:

    mise run install
  3. Run tests:

    mise run test

Development Workflow

Running Tests Locally

Execute the full test suite:

mise run test

Run specific test files:

uv run pytest my_tests/test_core_structure.py

Code Quality

Format and lint code:

mise run lint

Important Notes

Git Repository Requirement for Testing

Copier requires Git-tracked files when using vcs_ref="HEAD"

When running tests locally:

  • Ensure all template files are committed to Git before running tests
  • Copier uses Git to determine which files to include
  • Uncommitted files in the working directory are ignored by Copier

Before running tests:

git add .
git commit -m "WIP: template changes"

Tools Used

  • uv: Fast Python package installer and resolver
  • ruff: Fast Python linter and formatter
  • pytest: Testing framework
  • copier: Project template tool
  • prek: Git hooks framework

Troubleshooting

UV cache issues

Clear and resync:

uv cache clean
mise run install