1- PYTHON_BINARY := " python3"
2- VIRTUAL_ENV := " venv"
1+ VIRTUAL_ENV := " .venv"
32VIRTUAL_BIN := VIRTUAL_ENV / " bin"
43PROJECT_NAME := " project_name"
54TEST_DIR := " test"
@@ -12,14 +11,6 @@ bandit:
1211build :
1312 {{ VIRTUAL_BIN}} / python -m build
1413
15- # Runs the Black Python formatter against the project
16- black :
17- {{ VIRTUAL_BIN}} / black {{ PROJECT_NAME}} / {{ TEST_DIR}} /
18-
19- # Checks if the project is formatted correctly against the Black rules
20- black-check :
21- {{ VIRTUAL_BIN}} / black {{ PROJECT_NAME}} / {{ TEST_DIR}} / --check
22-
2314# Test the project and generate an HTML coverage report
2415coverage :
2516 {{ VIRTUAL_BIN}} / pytest --cov={{ PROJECT_NAME}} --cov-branch --cov-report=html --cov-report=lcov --cov-report=term-missing --cov-fail-under=90
@@ -29,28 +20,20 @@ clean:
2920 rm -rf {{ VIRTUAL_ENV}} dist *.egg-info .coverage htmlcov .*cache
3021 find . -name ' *.pyc' -delete
3122
32- # Run flake8 checks against the project
33- flake8 :
34- {{ VIRTUAL_BIN}} / flake8 {{ PROJECT_NAME}} / {{ TEST_DIR}} /
35-
3623# Lints the project
37- lint : black-check isort-check flake8 mypy bandit
24+ lint :
25+ {{ VIRTUAL_BIN}} / ruff check {{ PROJECT_NAME}} / {{ TEST_DIR}} /
26+ {{ VIRTUAL_BIN}} / ruff format --check {{ PROJECT_NAME}} / {{ TEST_DIR}} /
3827
39- # Runs all formatting tools against the project
40- lint-fix : black isort
28+ # Fixes lint issues
29+ lint-fix :
30+ {{ VIRTUAL_BIN}} / ruff check --fix {{ PROJECT_NAME}} / {{ TEST_DIR}} /
31+ {{ VIRTUAL_BIN}} / ruff format {{ PROJECT_NAME}} / {{ TEST_DIR}} /
4132
4233# Install the project locally
4334install :
44- {{ PYTHON_BINARY}} -m venv {{ VIRTUAL_ENV}}
45- {{ VIRTUAL_BIN}} / pip install -e ." [dev]"
46-
47- # Sorts imports throughout the project
48- isort :
49- {{ VIRTUAL_BIN}} / isort {{ PROJECT_NAME}} / {{ TEST_DIR}} /
50-
51- # Checks that imports throughout the project are sorted correctly
52- isort-check :
53- {{ VIRTUAL_BIN}} / isort {{ PROJECT_NAME}} / {{ TEST_DIR}} / --check-only
35+ uv venv
36+ uv pip install -e ' .[dev]'
5437
5538# Run mypy type checking on the project
5639mypy :
0 commit comments