Skip to content

Commit e82540f

Browse files
authored
chore: dependency tests in CI/CT (#848)
fixes #847 --------- Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 5c46f58 commit e82540f

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

.github/workflows/python.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ jobs:
5050
- name: Run tox
5151
run: poetry run tox run -e pyupgrade -s false
5252

53+
deptry:
54+
name: test dependencies
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
steps:
58+
- name: Checkout
59+
# see https://github.com/actions/checkout
60+
uses: actions/checkout@v4
61+
- name: Setup Python Environment
62+
# see https://github.com/actions/setup-python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
66+
architecture: 'x64'
67+
- name: Install poetry
68+
# see https://github.com/marketplace/actions/setup-poetry
69+
uses: Gr1N/setup-poetry@v9
70+
with:
71+
poetry-version: ${{ env.POETRY_VERSION }}
72+
- name: Install dependencies
73+
run: poetry install --no-root
74+
- name: Run tox
75+
run: poetry run tox run -e deptry -s false
76+
5377
coding-standards:
5478
name: Linting & CodingStandards
5579
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,32 @@ jobs:
6464
- name: Run tox
6565
run: poetry run tox run -e py -s false
6666

67+
deptry:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout code
71+
# see https://github.com/actions/checkout
72+
uses: actions/checkout@v4
73+
- name: Setup Python Environment
74+
# see https://github.com/actions/setup-python
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
78+
architecture: 'x64'
79+
- name: Install poetry
80+
# see https://github.com/marketplace/actions/setup-poetry
81+
uses: Gr1N/setup-poetry@v9
82+
with:
83+
poetry-version: ${{ env.POETRY_VERSION }}
84+
- name: Install dependencies
85+
run: poetry install --no-root
86+
- name: Run tox
87+
run: poetry run tox run -e deptry -s false
88+
6789
release:
6890
needs:
6991
- quicktest
92+
- deptry
7093
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
7194
# limit this to being run on regular commits, not the commits that semantic-release will create
7295
# but also allow manual workflow dispatch

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ tox = "4.27.0"
101101
xmldiff = "2.7.0"
102102
bandit = "1.8.5"
103103
pyupgrade = "3.20.0"
104+
deptry = "0.23.0"
104105

105106
[tool.semantic_release]
106107
# see https://python-semantic-release.readthedocs.io/en/latest/configuration.html
@@ -148,3 +149,6 @@ prerelease_token = "alpha"
148149
match = "(\\d+\\.0\\.0-(dev|rc)|dev/\\d+\\.0\\.0)"
149150
prerelease = true
150151
prerelease_token = "rc"
152+
153+
[tool.deptry]
154+
extend_exclude = ["docs", "examples", "package_aliases", "tools"]

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ envlist =
1010
mypy-{current,lowest}
1111
py{313,312,311,310,39}-{allExtras,noExtras}
1212
bandit
13+
deptry
1314
skip_missing_interpreters = True
1415
usedevelop = False
1516
download = False
@@ -44,6 +45,11 @@ commands =
4445
commands =
4546
poetry run bandit -c bandit.yml -v -r cyclonedx tests examples tools
4647

48+
[testenv:deptry]
49+
# config is in `pyproject.toml`
50+
command =
51+
poetry run deptry -v .
52+
4753
[testenv:pyupgrade]
4854
allowlist_externals = poetry, sh
4955
commands = sh -c "\

0 commit comments

Comments
 (0)