@@ -5,25 +5,12 @@ PY_IMPORT = rfc3161_client
55ALL_PY_SRCS := $(shell find src -name '* .py') \
66 $(shell find test -name '* .py')
77
8- # Optionally overriden by the user, if they're using a virtual environment manager.
9- VENV ?= .venv
10-
11- # On Windows, venv scripts/shims are under `Scripts` instead of `bin`.
12- VENV_BIN := $(VENV ) /bin
13- ifeq ($(OS ) ,Windows_NT)
14- VENV_BIN := $(VENV)/Scripts
15- endif
16-
178# Optionally overridden by the user in the `release` target.
189BUMP_ARGS :=
1910
2011# Optionally overridden by the user in the `test` target.
2112TESTS :=
2213
23- # Optionally overridden by the user/CI, to limit the installation to a specific
24- # subset of development dependencies.
25- INSTALL_EXTRA := dev
26-
2714# If the user selects a specific test pattern to run, set `pytest` to fail fast
2815# and only run tests that match the pattern.
2916# Otherwise, run all tests and enable coverage assertions, since we expect
4128 @echo " Run my targets individually!"
4229
4330.PHONY : dev
44- dev : $(VENV ) /pyvenv.cfg
45- @. $(VENV_BIN ) /activate && maturin develop --uv
46-
47- $(VENV ) /pyvenv.cfg : pyproject.toml
48- uv venv $(VENV )
49- @. $(VENV_BIN ) /activate && uv pip install -e ' .[$(INSTALL_EXTRA)]'
31+ dev :
32+ uv sync --group dev
33+ uv run maturin develop --uv
5034
5135.PHONY : lint
52- lint : $(VENV ) /pyvenv.cfg
53- . $(VENV_BIN ) /activate && \
54- ruff format --check && \
55- ruff check
56- cargo fmt --check --manifest-path rust/Cargo.toml
57- cargo fmt --check --manifest-path rust/tsp-asn1/Cargo.toml
58- . $(VENV_BIN ) /activate && \
59- interrogate -c pyproject.toml .
60- . $(VENV_BIN ) /activate && \
61- ty check
36+ lint :
37+ uv sync --group lint
38+ uv run ruff format --check && \
39+ uv run ruff check && \
40+ cargo fmt --check --manifest-path rust/Cargo.toml && \
41+ cargo fmt --check --manifest-path rust/tsp-asn1/Cargo.toml && \
42+ uv run interrogate -c pyproject.toml . && \
43+ uv run ty check
6244
6345.PHONY : reformat
6446reformat :
65- . $( VENV_BIN ) /activate && \
66- ruff format && \
67- ruff check --fix
68- cargo fmt --manifest-path rust/Cargo.toml
69- cargo fmt --manifest-path rust/tsp-asn1/Cargo.toml
47+ uv sync --group lint
48+ uv run ruff format && \
49+ uv run ruff check --fix && \
50+ cargo fmt --manifest-path rust/Cargo.toml && \
51+ cargo fmt --manifest-path rust/tsp-asn1/Cargo.toml
7052
7153.PHONY : doc
7254doc :
7355 @echo " No documentation set up"
7456
7557
7658.PHONY : test tests
77- test tests : $( VENV ) /pyvenv.cfg
78- . $( VENV_BIN ) /activate && \
79- pytest --cov=$(PY_IMPORT ) $(T ) $(TEST_ARGS ) && \
80- python -m coverage report -m $(COV_ARGS )
81- cargo test --manifest-path rust/Cargo.toml
82- cargo test --manifest-path rust/tsp-asn1/Cargo.toml
59+ test tests :
60+ uv sync --group test
61+ uv run pytest --cov=$(PY_IMPORT ) $(T ) $(TEST_ARGS ) && \
62+ uv run coverage report -m $(COV_ARGS ) && \
63+ cargo test --manifest-path rust/Cargo.toml && \
64+ cargo test --manifest-path rust/tsp-asn1/Cargo.toml
0 commit comments