@@ -18,6 +18,37 @@ Thank you for your interest in contributing to {{ cookiecutter.project_name }}!
1818 cd {{ cookiecutter.project_slug }}
1919 ```
2020
21+ {%- if cookiecutter.use_uv == "y" %}
22+
23+ 2 . ** Set up development environment with uv (Recommended)**
24+
25+ Install [ uv] ( https://docs.astral.sh/uv/ ) if you haven't already:
26+ ``` bash
27+ # On macOS and Linux
28+ curl -LsSf https://astral.sh/uv/install.sh | sh
29+
30+ # On Windows
31+ powershell -c " irm https://astral.sh/uv/install.ps1 | iex"
32+ ```
33+
34+ Then set up the project:
35+ ``` bash
36+ # Install dependencies and create virtual environment
37+ uv sync
38+
39+ # Install the package in development mode
40+ uv pip install -e " .[dev]"
41+ ```
42+
43+ 3 . ** Alternative: Create a virtual environment with pip**
44+ ``` bash
45+ python -m venv venv
46+ source venv/bin/activate # On Windows: venv\Scripts\activate
47+ pip install -e " .[dev]"
48+ ```
49+
50+ {%- else %}
51+
21522 . ** Create a virtual environment**
2253 ``` bash
2354 python -m venv venv
@@ -29,11 +60,17 @@ Thank you for your interest in contributing to {{ cookiecutter.project_name }}!
2960 pip install -e " .[dev]"
3061 ```
3162
63+ {%- endif %}
64+
3265{%- if cookiecutter.use_pre_commit == "y" %}
3366
34674 . ** Install pre-commit hooks**
3568 ``` bash
69+ {%- if cookiecutter.use_uv == " y" %}
70+ uv run pre-commit install
71+ {%- else %}
3672 pre-commit install
73+ {%- endif %}
3774 ` ` `
3875{%- endif %}
3976
@@ -46,13 +83,23 @@ We use [Ruff](https://github.com/astral-sh/ruff) for code formatting and linting
4683
4784` ` ` bash
4885# Format code
86+ {%- if cookiecutter.use_uv == " y" %}
87+ uv run ruff format
88+
89+ # Check for linting issues
90+ uv run ruff check
91+
92+ # Fix auto-fixable issues
93+ uv run ruff check --fix
94+ {%- else %}
4995ruff format
5096
5197# Check for linting issues
5298ruff check
5399
54100# Fix auto-fixable issues
55101ruff check --fix
102+ {%- endif %}
56103` ` `
57104{%- endif %}
58105
@@ -63,7 +110,11 @@ ruff check --fix
63110We use [MyPy](https://mypy.readthedocs.io/) for static type checking:
64111
65112` ` ` bash
113+ {%- if cookiecutter.use_uv == " y" %}
114+ uv run mypy src/{{ cookiecutter.project_slug }}
115+ {%- else %}
66116mypy src/{{ cookiecutter.project_slug }}
117+ {%- endif %}
67118` ` `
68119{%- endif %}
69120
@@ -75,6 +126,18 @@ We use [pytest](https://pytest.org/) for testing:
75126
76127` ` ` bash
77128# Run all tests
129+ {%- if cookiecutter.use_uv == " y" %}
130+ uv run pytest
131+
132+ # Run with coverage
133+ uv run pytest --cov={{ cookiecutter.project_slug }}
134+
135+ # Run specific test file
136+ uv run pytest tests/test_core.py
137+
138+ # Run tests in parallel
139+ uv run pytest -n auto
140+ {%- else %}
78141pytest
79142
80143# Run with coverage
@@ -85,6 +148,7 @@ pytest tests/test_core.py
85148
86149# Run tests in parallel
87150pytest -n auto
151+ {%- endif %}
88152` ` `
89153
90154Make sure to write tests for any new functionality you add.
@@ -97,7 +161,11 @@ Make sure to write tests for any new functionality you add.
97161We use [Bandit](https://bandit.readthedocs.io/) for security checks:
98162
99163` ` ` bash
164+ {%- if cookiecutter.use_uv == " y" %}
165+ uv run bandit -r src/{{ cookiecutter.project_slug }}/
166+ {%- else %}
100167bandit -r src/{{ cookiecutter.project_slug }}/
168+ {%- endif %}
101169` ` `
102170{%- endif %}
103171
0 commit comments