Skip to content

Commit b227aea

Browse files
committed
Export poetry dependencies in Makefile to be able to use tox caching
Signed-off-by: Federico Busetti <729029+febus982@users.noreply.github.com>
1 parent 84b3a4a commit b227aea

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ update-dependencies:
3535

3636
fix: format-fix lint-fix
3737
check:
38+
poetry export -f requirements.txt --output /tmp/requirements.txt --with dev
3839
tox
3940

4041
docs:

tox.ini

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ env_list =
1212
bandit
1313

1414
[testenv]
15-
allowlist_externals = poetry, pytest
15+
; The file /tmp/requirements.txt is created automatically if you run tox
16+
; using `make check` command, otherwise manually run
17+
; `poetry export -f requirements.txt --output /tmp/requirements.txt --with dev`
1618
; Poetry is really bad in identifying running virtualenvs, so we can't use
1719
; directly poetry install. This is the best hacky way to install poetry
1820
; requirements inside tox.
19-
commands_pre =
20-
poetry export -f requirements.txt --output /tmp/requirements.txt --with dev
21-
pip install -Uqr /tmp/requirements.txt
21+
deps =
22+
-r/tmp/requirements.txt
2223
commands =
2324
pytest
2425

@@ -28,25 +29,17 @@ commands =
2829
pytest --cov
2930

3031
[testenv:typing]
31-
allowlist_externals = poetry, mypy
32-
; commands_pre is inherited from testenv
3332
commands =
3433
mypy
3534

3635
[testenv:format]
37-
allowlist_externals = poetry, black
38-
; commands_pre is inherited from testenv
3936
commands =
4037
black --check .
4138

4239
[testenv:lint]
43-
allowlist_externals = poetry, ruff
44-
; commands_pre is inherited from testenv
4540
commands =
4641
ruff .
4742

4843
[testenv:bandit]
49-
allowlist_externals = poetry, bandit
50-
; commands_pre is inherited from testenv
5144
commands =
5245
bandit -c .bandit.yml -r .

0 commit comments

Comments
 (0)