@@ -5,6 +5,10 @@ docker_compose_path = "docker-compose.yml"
5
5
DC = docker-compose -f $(docker_compose_path )
6
6
DC_RUN = $(DC ) run --rm
7
7
DC_RUN_MNG = $(DC_RUN ) django python manage.py
8
+ {%- if cookiecutter.package_manager == 'Poetry' %}
9
+ MANAGER = poetry
10
+ {%- if cookiecutter.package_manager == 'uv' %}
11
+ MANAGER = uv
8
12
9
13
# ##################################################################################################
10
14
# # Build/run/stop/etc. ############################################################################
@@ -46,7 +50,7 @@ migrate: # apply db migrations
46
50
47
51
test :
48
52
@echo ' Running tests with arguments: ' $(pytest-args )
49
- $(DC_RUN ) django poetry run pytest --ds=settings.test -v $(pytest-args ) .
53
+ $(DC_RUN ) django $( MANAGER ) run pytest --ds=settings.test -v $(pytest-args ) .
50
54
51
55
test-coverage :
52
56
@echo ' Running test coverage with arguments: ' $(pytest-args )
@@ -56,34 +60,43 @@ test-coverage:
56
60
# # Code tools #####################################################################################
57
61
58
62
install-pre-commit :
59
- poetry run pre-commit install
63
+ $( MANAGER ) run pre-commit install
60
64
61
65
check :
62
66
{%- if cookiecutter.linter == 'Flake8' %}
63
- poetry run black --check backend
64
- poetry run isort --check backend
67
+ $(MANAGER) run black --check backend
68
+ $(MANAGER) run isort --check backend
65
69
{%- endif %}
66
70
{%- if cookiecutter.linter == 'Ruff' %}
67
- poetry run ruff check backend
71
+ $(MANAGER) run ruff check backend
68
72
69
73
format :
70
74
{%- if cookiecutter.linter == 'Flake8' %}
71
- poetry run black .
72
- poetry run isort .
75
+ $(MANAGER) run black .
76
+ $(MANAGER) run isort .
73
77
{%- endif %}
74
78
{%- if cookiecutter.linter == 'Ruff' %}
75
- poetry run ruff check --fix .
79
+ $(MANAGER) run ruff check --fix .
76
80
77
81
lint :
78
82
{%- if cookiecutter.linter == 'Flake8' %}
79
- poetry run flake8 --inline-quotes '"'
83
+ $(MANAGER) run flake8 --inline-quotes '"'
80
84
make check
85
+
86
+ format :
87
+ $(MANAGER ) run black .
88
+ $(MANAGER ) run isort .
89
+
90
+ lint :
91
+ $(MANAGER ) run black --check backend
92
+ $(MANAGER ) run isort --check backend
93
+ $(MANAGER ) run flake8 --inline-quotes ' "'
81
94
@# For some reason, mypy and pylint fails to resolve PYTHONPATH, set manually.
82
- PYTHONPATH=./app poetry run pylint app
83
- PYTHONPATH=./app poetry run mypy --namespace-packages --show-error-codes app --check-untyped-defs --ignore-missing-imports --show-traceback
95
+ PYTHONPATH=./app $( MANAGER ) run pylint app
96
+ PYTHONPATH=./app $( MANAGER ) run mypy --namespace-packages --show-error-codes app --check-untyped-defs --ignore-missing-imports --show-traceback
84
97
85
98
safety :
86
- poetry run safety check --policy-file=.safety-policy.yml
99
+ $( MANAGER ) run safety check --policy-file=.safety-policy.yml
87
100
88
101
check-changed-loc :
89
102
chmod +x ./scripts/pr-max-diff-checker.sh
0 commit comments