Skip to content

Commit 41ed808

Browse files
committed
Remove git sha from dev version number
PyPI error: The use of local versions ... is not allowed
1 parent 698d0b6 commit 41ed808

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: python version.py check "${{ github.ref }}"
3737
- name: Add untagged version suffix
3838
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
39-
run: python version.py update ${{ github.sha }}
39+
run: python version.py update
4040
- name: Build sdist
4141
run: pipx run build --sdist
4242
- uses: actions/upload-artifact@v4

version.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ def check(ref):
3333

3434

3535
def update(sha=""):
36-
"""Add a timestamped dev version qualifier to the current version"""
36+
"""Add a timestamped dev version qualifier to the current version
37+
38+
Note: pypi does not allow the "local" version component, which
39+
is where we put the git sha. Do not pass a sha argument when
40+
updating the version for a pypi release.
41+
"""
3742
path = Path(__file__).parent / PACKAGE_NAME / "__init__.py"
3843
vexpr = re.compile(r"""(?<=^__version__ = )['"](.+)['"]$""", flags=re.M)
3944
with open(path, "r+") as file:

0 commit comments

Comments
 (0)