Skip to content

Commit ec1fc12

Browse files
authored
Fix wrong version numbers for PyPI releases (#317)
For test releases to TestPyPI we have to edit the setuptools_scm configuration to produce valid version numbers. But it turns out that this breaks the number for actual releases. To fix it, only edit the configuration on non-release builds.
1 parent 8f322d4 commit ec1fc12

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/pypi.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@ jobs:
5757
- name: List installed packages
5858
run: python -m pip freeze
5959

60-
- name: Build source and wheel distributions
60+
- name: Don't use local version numbers for TestPyPI uploads
61+
if: github.event_name != 'release'
6162
run: |
6263
# Change setuptools-scm local_scheme to "no-local-version" so the
6364
# local part of the version isn't included, making the version string
6465
# compatible with Test PyPI.
6566
sed --in-place "s/node-and-date/no-local-version/g" setup.py
67+
68+
- name: Build source and wheel distributions
69+
run: |
6670
python setup.py sdist bdist_wheel
6771
echo ""
6872
echo "Generated files:"

0 commit comments

Comments
 (0)