-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (55 loc) · 1.37 KB
/
Makefile
File metadata and controls
66 lines (55 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SHELL := /bin/bash
PY_IMPORT = {{ cookiecutter.__project_import }}
# Optionally overridden by the user in the `test` target.
TESTS :=
# If the user selects a specific test pattern to run, set `pytest` to fail fast
# and only run tests that match the pattern.
# Otherwise, run all tests and enable coverage assertions, since we expect
# complete test coverage.
ifneq ($(TESTS),)
TEST_ARGS := -x -k $(TESTS)
COV_ARGS :=
else
TEST_ARGS :=
COV_ARGS := --fail-under 100
endif
.PHONY: all
all:
@echo "Run my targets individually!"
.PHONY: dev
dev:
uv sync --group dev
uv run prek install
{%- if cookiecutter.entry_point %}
.PHONY: run
run:
uv run {{ cookiecutter.entry_point }} $(ARGS)
{%- endif %}
.PHONY: lint
lint:
uv sync --group lint
uv run ruff format --check && \
uv run ruff check && \
uv run ty check{% if cookiecutter.docstring_coverage %} && \
uv run interrogate -c pyproject.toml .{% endif %}
.PHONY: format
format:
uv sync --group lint
uv run ruff format && \
uv run ruff check --fix
.PHONY: test
test:
uv sync --group test
uv run pytest -svv --timeout=300 --cov=$(PY_IMPORT) $(T) $(TEST_ARGS)
uv run coverage report -m $(COV_ARGS)
.PHONY: doc
{%- if cookiecutter.documentation == 'pdoc' %}
doc:
uv run pdoc -o html $(PY_IMPORT)
{%- elif cookiecutter.documentation == 'none' %}
doc:
@echo "No documentation set up"
{%- endif %}
.PHONY: build
build:
uv build