@@ -5,6 +5,11 @@ 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
+ {%- elif cookiecutter.package_manager == 'uv' %}
11
+ MANAGER = uv
12
+ {%- endif %}
8
13
9
14
# ##################################################################################################
10
15
# # Build/run/stop/etc. ############################################################################
@@ -46,7 +51,7 @@ migrate: # apply db migrations
46
51
47
52
test :
48
53
@echo ' Running tests with arguments: ' $(pytest-args )
49
- $(DC_RUN ) django poetry run pytest --ds=settings.test -v $(pytest-args ) .
54
+ $(DC_RUN ) django $( MANAGER ) run pytest --ds=settings.test -v $(pytest-args ) .
50
55
51
56
test-coverage :
52
57
@echo ' Running test coverage with arguments: ' $(pytest-args )
@@ -56,34 +61,33 @@ test-coverage:
56
61
# # Code tools #####################################################################################
57
62
58
63
install-pre-commit :
59
- poetry run pre-commit install
64
+ $( MANAGER ) run pre-commit install
60
65
61
66
check :
62
67
{%- if cookiecutter.linter == 'Flake8' %}
63
- poetry run black --check backend
64
- poetry run isort --check backend
68
+ $(MANAGER) run black --check backend
69
+ $(MANAGER) run isort --check backend
70
+ {%- elif cookiecutter.linter == 'Ruff' %}
71
+ $(MANAGER) run ruff check backend
65
72
{%- endif %}
66
- {%- if cookiecutter.linter == 'Ruff' %}
67
- poetry run ruff check backend
68
73
69
74
format :
70
75
{%- if cookiecutter.linter == 'Flake8' %}
71
- poetry run black .
72
- poetry run isort .
76
+ $(MANAGER) run black .
77
+ $(MANAGER) run isort .
78
+ {%- elif cookiecutter.linter == 'Ruff' %}
79
+ $(MANAGER) run ruff check --fix .
73
80
{%- endif %}
74
- {%- if cookiecutter.linter == 'Ruff' %}
75
- poetry run ruff check --fix .
76
81
77
82
lint :
78
- {%- if cookiecutter.linter == 'Flake8' %}
79
- poetry run flake8 --inline-quotes '"'
83
+ {{ ' $(MANAGER) run flake8 --inline-quotes \'\"\'' if cookiecutter.linter == 'Flake8' }}
80
84
make check
81
85
@# 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
86
+ PYTHONPATH=./app $(MANAGER) run pylint app
87
+ PYTHONPATH=./app $(MANAGER) run mypy --namespace-packages --show-error-codes app --check-untyped-defs --ignore-missing-imports --show-traceback
84
88
85
89
safety :
86
- poetry run safety check --policy-file=.safety-policy.yml
90
+ $( MANAGER ) run safety check --policy-file=.safety-policy.yml
87
91
88
92
check-changed-loc :
89
93
chmod +x ./scripts/pr-max-diff-checker.sh
0 commit comments