33PYMODULE := project_name
44TESTS := tests
55INSTALL_STAMP := .install.stamp
6- POETRY := $(shell command -v poetry 2> /dev/null)
6+ UV := $(shell command -v uv 2> /dev/null)
77MYPY := $(shell command -v mypy 2> /dev/null)
88
99.DEFAULT_GOAL := help
@@ -24,31 +24,25 @@ help:
2424 @echo " Check the Makefile to know exactly what each target is doing."
2525 @echo " Most actions are configured in 'pyproject.toml'."
2626
27- install : $(INSTALL_STAMP )
28- $(INSTALL_STAMP ) : pyproject.toml
29- @if [ -z $( POETRY) ]; then echo " Poetry could not be found. See https://python-poetry.org/docs/" ; exit 2; fi
30- $(POETRY ) run pip install --upgrade pip setuptools
31- $(POETRY ) install --with dev,tests,linters
32- touch $(INSTALL_STAMP )
27+ install :
28+ @if [ -z $( UV) ]; then echo " uv could not be found. See https://docs.astral.sh/uv/" ; exit 2; fi
29+ $(UV ) sync --frozen
3330
3431.PHONY : lint
3532lint : $(INSTALL_STAMP )
3633 # Configured in pyproject.toml
37- # Skips mypy if not installed
38- #
39- # $(POETRY) run black --check $(TESTS) $(PYMODULE) --diff
40- @if [ -z $(MYPY) ]; then echo "Mypy not found, skipping..."; else echo "Running Mypy..."; $(POETRY) run mypy $(PYMODULE) $(TESTS); fi
41- @echo "Running Ruff..."; $(POETRY) run ruff . --fix
34+ @echo "Running Ruff..."; $(UV) run ruff check --fix .
35+ @echo "Running Mypy..."; $(UV) run mypy $(PYMODULE) $(TESTS)
4236 @echo "Running Cargo lint..."; cargo lint
4337
4438.PHONY : test
4539test : $(INSTALL_STAMP )
4640 # Configured in pyproject.toml
47- $(POETRY ) run pytest
41+ $(UV ) run pytest
4842
4943.PHONY : build
5044build : $(INSTALL_STAMP )
51- $(POETRY ) run maturin develop
45+ $(UV ) run maturin develop
5246
5347.PHONY : clean
5448clean :
0 commit comments