@@ -2,27 +2,9 @@ SHELL := /bin/bash
22
33PY_IMPORT = {{ cookiecutter.__project_import }}
44
5- # Optionally overriden by the user, if they're using a virtual environment manager.
6- # Warning: changing this name to something else than '.venv' will make working with
7- # uv harder.
8- VENV ?= .venv
9-
10- # On Windows, venv scripts/shims are under `Scripts` instead of `bin`.
11- VENV_BIN := $(VENV ) /bin
12- ifeq ($(OS ) ,Windows_NT)
13- VENV_BIN := $(VENV)/Scripts
14- endif
15-
16- # Optionally overridden by the user in the `release` target.
17- BUMP_ARGS :=
18-
195# Optionally overridden by the user in the `test` target.
206TESTS :=
217
22- # Optionally overridden by the user/CI, to limit the installation to a specific
23- # subset of development dependencies.
24- INSTALL_EXTRA := dev
25-
268# If the user selects a specific test pattern to run, set `pytest` to fail fast
279# and only run tests that match the pattern.
2810# Otherwise, run all tests and enable coverage assertions, since we expect
@@ -39,21 +21,14 @@ endif
3921all :
4022 @echo " Run my targets individually!"
4123
42- .PHONY : dev
43- dev : $(VENV ) /pyvenv.cfg
44-
4524{%- if cookiecutter.entry_point %}
4625.PHONY : run
47- run : $( VENV ) /pyvenv.cfg
26+ run :
4827 uv run {{ cookiecutter.entry_point }} $(ARGS )
4928{%- endif %}
5029
51- $(VENV ) /pyvenv.cfg : pyproject.toml
52- uv venv $(VENV )
53- uv sync --group ' $(INSTALL_EXTRA)'
54-
5530.PHONY : lint
56- lint : $( VENV ) /pyvenv.cfg
31+ lint :
5732 uv run ruff format --check && \
5833 uv run ruff check && \
5934 uv run mypy
@@ -67,20 +42,20 @@ reformat:
6742 uv run ruff format && \
6843 uv run ruff check --fix
6944
70- .PHONY : test tests
71- test tests : $( VENV ) /pyvenv.cfg
45+ .PHONY : test
46+ test :
7247 uv run pytest --cov=$(PY_IMPORT ) $(T ) $(TEST_ARGS )
7348 uv run coverage report -m $(COV_ARGS )
7449
7550.PHONY : doc
7651{%- if cookiecutter.documentation == 'pdoc' %}
77- doc : $( VENV ) /pyvenv.cfg
52+ doc :
7853 uv run pdoc -o html $(PY_IMPORT )
7954{%- elif cookiecutter.documentation == 'none' %}
8055doc :
8156 @echo " No documentation set up"
8257{%- endif %}
8358
8459.PHONY : package
85- package : $( VENV ) /pyvenv.cfg
60+ package :
8661 uv build
0 commit comments