Skip to content

Commit c62e377

Browse files
committed
pyupgrade
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 8ac09b6 commit c62e377

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.github/workflows/python.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ env:
2626
TESTS_REPORTS_ARTIFACT: tests-reports
2727

2828
jobs:
29+
pyupgrade:
30+
name: test upgradable
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
steps:
34+
- name: Checkout
35+
# see https://github.com/actions/checkout
36+
uses: actions/checkout@v4
37+
- name: Setup Python Environment
38+
# see https://github.com/actions/setup-python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
42+
architecture: 'x64'
43+
- name: Install poetry
44+
# see https://github.com/marketplace/actions/setup-poetry
45+
uses: Gr1N/setup-poetry@v9
46+
with:
47+
poetry-version: ${{ env.POETRY_VERSION }}
48+
- name: Install dependencies
49+
run: poetry install --no-root
50+
- name: Run tox
51+
run: poetry run tox run -e pyupgrade -s false
52+
2953
coding-standards:
3054
name: Linting & CodingStandards
3155
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ tomli = { version = "2.2.1", python = "<3.11" }
9898
tox = "4.26.0"
9999
xmldiff = "2.7.0"
100100
bandit = "1.8.3"
101+
pyupgrade = "3.20.0"
101102

102103
[tool.semantic_release]
103104
# see https://python-semantic-release.readthedocs.io/en/latest/configuration.html

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,14 @@ commands =
4444
commands =
4545
poetry run bandit -c bandit.yml -v -r cyclonedx tests examples tools
4646

47+
[testenv:pyupgrade]
48+
allowlist_externals = poetry, sh
49+
commands = sh -c "\
50+
find cyclonedx typings tests tools examples -type f \( -name '*.py' -or -name '*.pyi' \) -print0 \
51+
| xargs -0 poetry run pyupgrade --py39-plus "
4752

53+
[testenv:isort]
54+
commands = poetry run isort .
55+
56+
[testenv:autopep8]
57+
commands = poetry run autopep8 --in-place -r .

0 commit comments

Comments
 (0)