Skip to content

Commit ff6287f

Browse files
committed
Use "build" instead of setup.py
setup.py is now discourage. Also remove setuptools and wheel dependencies
1 parent 3b26823 commit ff6287f

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,33 @@ on:
1010
jobs:
1111
pypi-publish:
1212

13-
runs-on: ubuntu-24.04
13+
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.10"]
16+
python-version: ["3.12"]
1717

1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v4
21+
2122
- name: Set up Python ${{ matrix.python-version }}
2223
uses: actions/setup-python@v5
2324
with:
2425
python-version: ${{ matrix.python-version }}
26+
2527
- name: Install dependencies
2628
run: |
27-
python -m pip install --upgrade "pip<24.1" setuptools twine wheel
28-
python setup.py sdist bdist_wheel
29-
# "python setup.py" is no longer recommended.
30-
- name: Publish a Python distribution to PyPI
29+
pip install --upgrade build pip twine
30+
31+
- name: Build source distribution and wheels
32+
run: python -m build
33+
34+
- name: Check distributions
35+
run: twine check dist/*
36+
37+
- name: Publish to PyPI
3138
uses: pypa/gh-action-pypi-publish@release/v1
3239
with:
40+
skip-existing: true
3341
user: __token__
3442
password: ${{ secrets.PYPI_API_TOKEN }}

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10
1+
3.12

0 commit comments

Comments
 (0)