Skip to content

Commit c100ee3

Browse files
Zoran Simiczsimic
authored andcommitted
Use trusted publishing, modernized linter setup
1 parent d73ed1c commit c100ee3

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ jobs:
99
publish:
1010

1111
runs-on: ubuntu-latest
12+
environment: release
13+
permissions:
14+
id-token: write # mandatory for trusted publishing
1215

1316
steps:
1417
- uses: actions/checkout@v4
1518
- uses: actions/setup-python@v5
1619
with:
1720
python-version: "3.11"
1821

19-
- run: pip install -U pip setuptools wheel twine 'tox<4'
22+
- run: pip install -U pip setuptools wheel tox
2023
- run: tox -e py,docs,style
2124
- run: python setup.py sdist bdist_wheel
2225

23-
- name: Publish sdist and wheel
24-
env:
25-
TWINE_USERNAME: __token__
26-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
27-
run: twine upload --non-interactive dist/*
26+
- name: Publish to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1

tox.ini

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname}
77
usedevelop = True
88
deps = -rrequirements.txt
99
-rtests/requirements.txt
10-
commands = pytest {posargs:-vv --cov=src/ --cov-report=xml tests/}
10+
commands = pytest {posargs:-vv --cov=src/ --cov=tests/ --cov-report=xml tests/}
1111

1212
[testenv:coverage]
1313
setenv = COVERAGE_FILE={toxworkdir}/.coverage
@@ -21,15 +21,14 @@ commands = coverage combine
2121
[testenv:style]
2222
skip_install = True
2323
deps = ruff
24-
commands = ruff check --diff
25-
ruff check --output-format=full
24+
commands = ruff check
2625
ruff format --diff
2726

2827
[testenv:reformat]
2928
skip_install = True
3029
deps = ruff
31-
commands = ruff check --fix {posargs:}
32-
ruff format {posargs:}
30+
commands = ruff check --fix
31+
ruff format
3332

3433
[testenv:docs]
3534
skip_install = True

0 commit comments

Comments
 (0)