Skip to content

Commit

Permalink
Fix wrong version numbers for PyPI releases (#216)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
santisoler authored Mar 18, 2021
1 parent 3cc75b7 commit 84ae223
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ jobs:
- name: List installed packages
run: python -m pip freeze

- name: Build source and wheel distributions
- name: Don't use local version numbers for TestPyPI uploads
if: github.event_name != 'release'
run: |
# Change setuptools-scm local_scheme to "no-local-version" so the
# local part of the version isn't included, making the version string
# compatible with Test PyPI.
sed --in-place "s/node-and-date/no-local-version/g" setup.py
python setup.py sdist bdist_wheel
- name: Build source and wheel distributions
run: python setup.py sdist bdist_wheel
echo ""
echo "Generated files:"
ls -lh dist/
Expand Down

0 comments on commit 84ae223

Please sign in to comment.