stubs release fix#10434
Conversation
There was a problem hiding this comment.
I don't think this is the right fix. The stubs version error from the 10.0.0-alpha.7 release build is here:https://github.com/adafruit/circuitpython/actions/runs/15716969701/job/44296628261#step:13:42, and excerpted below.
Note that the version number is already 10.0.0a8.dev0, even though this is exactly 10.0.0-alpha.7. We haven't gotten to alpha.8 (a8) yet.
I think the new logic in #10312 (or maybe it's something else), is not converting the current tag properly. It would probably be worth looking at the old way the filename was generated when alpha.4 was released to see what the difference is. I don't think it should be necessary to reparse the version number from Python style to semver style. It should be generated properly. Maybe it's something in the PyPi stuff we use to build the PyPi release.
un # python -m build was run by 'make stubs'
17
Uploading dev release to PyPi
18
Uploading distributions to https://upload.pypi.org/legacy/
19
Uploading
20
circuitpython_stubs-10.0.0a8.dev0+gc5128a9902.d20250617-py3-none-any.whl
21
[...
]100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB • 00:00 • 4.2 MB/s
35
25hWARNING Error during upload. Retry with the --verbose option for more details.
36
ERROR HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
37
The use of local versions in
38
<Version('10.0.0a8.dev0+gc5128a9902.d20250617')> is not allowed. See
39
https://packaging.python.org/specifications/core-metadata for more
40
information.
I think this should fix #10361
python -msetuptools_scmreturns a full version string which seems to include some hex hashes and adevnumber i.e.10.0.0a8.dev3+g25132775c1.d20250618, but pypi does not like all of this being included in the name when we attempt to upload it for stubs release.This change uses
cutto omit the 3rd period and anything that follows it, so we end up with a value like10.0.0a8which matches how the versions used to be the last time this succeeded with alpha4.