Skip to content

Commit dd6d75e

Browse files
committed
update python release to pypi
1 parent ef35f75 commit dd6d75e

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

.github/workflows/python-release.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1+
name: Publish Python 🐍 distributions 📦 to PyPI with Poetry
22

33
on:
44
release:
55
types: [published]
66

77
jobs:
88
build-n-publish:
9-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
9+
name: Build and publish with Poetry
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@master
14-
- name: Set up Python 3.9
15-
uses: actions/setup-python@v3
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.12
17+
uses: actions/setup-python@v5
1618
with:
17-
python-version: 3.9
19+
python-version: "3.12"
20+
21+
- name: Install Poetry and Versioning Plugin
22+
run: |
23+
pip install poetry
24+
poetry self add "poetry-dynamic-versioning[plugin]"
25+
26+
- name: Build package
27+
run: poetry build
1828

19-
- name: Install pypa/build
20-
run: >-
21-
python -m
22-
pip install
23-
build
24-
--user
25-
- name: Build a binary wheel and a source tarball
26-
run: >-
27-
python -m
28-
build
29-
--sdist
30-
--wheel
31-
--outdir dist/
32-
.
33-
- name: Publish distribution 📦 to PyPI
34-
if: startsWith(github.ref, 'refs/tags')
29+
- name: Publish to PyPI
3530
uses: pypa/gh-action-pypi-publish@release/v1
3631
with:
3732
password: ${{ secrets.CHEMOTOOLS }}

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ mypy = "^1.13.0"
2222
pandas-stubs = "^2.2.3.241126"
2323
scipy-stubs = "^1.15.1.0"
2424

25+
[tool.poetry-dynamic-versioning]
26+
enable = true
27+
2528
[tool.pytest.ini_options]
2629
filterwarnings = "always"
2730

0 commit comments

Comments
 (0)