Skip to content

Commit eb97a7c

Browse files
committed
Fix PyPI publish, add tests and update action names
1 parent 3b318ac commit eb97a7c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

.github/workflows/python-publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will upload a Python Package using Twine when a release is created
22
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
33

4-
name: Publish to PyPI
4+
name: Upload package to PyPI
55

66
on:
77
release:
@@ -21,18 +21,22 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
2426
- name: Set up Python
2527
uses: actions/setup-python@v4
2628
with:
2729
python-version: '3.x'
2830
- name: Install dependencies
2931
run: |
3032
python -m pip install --upgrade pip
31-
pip install setuptools wheel twine
33+
pip install setuptools setuptools_scm wheel twine
3234
- name: Build and publish
3335
env:
3436
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
3537
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
38+
# Build package, test pip install works, then upload to PyPI with twine
3639
run: |
3740
python setup.py sdist bdist_wheel
41+
pip install dist/*.tar.gz
3842
twine upload dist/*

.github/workflows/python-package.yml renamed to .github/workflows/python-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: build
4+
name: Tests
55

66
on:
77
push:

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[build-system]
22
# Minimum requirements for the build system to execute.
33
requires = [
4-
"setuptools>=42",
5-
"setuptools_scm[toml]>=6.2",
4+
"setuptools>=64",
5+
"setuptools_scm[toml]>=8",
66
"wheel",
77
]
88
build-backend = "setuptools.build_meta"
99

1010
# To write version to file
1111
[tool.setuptools_scm]
12-
write_to = "xdem/_version.py"
12+
version_file = "xdem/_version.py"
1313
fallback_version = "0.0.1"
1414

1515
[tool.black]

0 commit comments

Comments
 (0)