-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
Fallout from #287. Because the CI no longer applies a .devN suffix to the version then test.pypi.org rightly rejects the second package built with that <major>.<minor>.<patch>
, e.g. https://github.com/bytecodealliance/wasmtime-py/actions/runs/15710411138/job/44266848706
Uploading distributions to https://test.pypi.org/legacy/
Uploading wasmtime-33.0.0-py3-none-android_26_arm64_v8a.whl
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Bad Request
Possible changes/fixes
- Reintroduce .devN, where N might be some combination of
- number of commits from HEAD to initial commit (previous scheme)
- number of commits since last major.minor.patch
- commit hash
- a build id provided by CI platform
- timestamp of last commit
- timestamp of build
- arbitrary UUID
- Publish to test.pypi only when the version has not been previously uploaded
- Don't publish to test.pypi.org on merges
Considerations
- Any negative interactions with people installing directly from github repro (e.g.
pip install git+https://github.com/bytecodealliance/wasmtime-py.git
) - Any impact on release workflow for project maintainers?
Initial discussion #287 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Activity
moreati commentedon Jun 17, 2025
Trial:
--build-number=<N>
Result: Negative/partial
Reason: Gets applied to wheel, but not to sdist
alexcrichton commentedon Jun 17, 2025
The original intent of the test.pypi.org bits was to test all the platform name tags and such to ensure that pypi accepts everything and ensuring it's discovered before a release, but beyond that it's AFAIK not too useful to publish to test.pypi.org.
What about this: a manual-trigger-only github actions workflow (e.g.
workflow_dispatch
trigger) which publishes to test.pypi.org. That way we can maintain the version in-tree and put appropriate prerelease tags and such on it, and then when a dicy change comes in after merging I can trigger the workflow to publish to test.pypi.org and see if it passes. That would disable auto-publish but still enable publishes to happen in some cases.moreati commentedon Jun 18, 2025
I think auto-publish and auto-version are doable. I'm evaluating some more candidates today. I'll create a PR this evening or tomorrow.
moreati commentedon Jun 18, 2025
Trial: https://setuptools-scm.readthedocs.io
Result: candidate
Discussion: Automatically generates/guesses version from source control (git) data. The version strategy and guessing behaviour are configurable. E.g.
Notes:
moreati commentedon Jun 18, 2025
Trial: https://setuptools-git-versioning.readthedocs.io
Result: Candidate, leaning to recommended
Discussion: The recommended use pattern is file based, meaning the under-development version (e.g. 33.1.0) is stored in a plain text file, manually updated. A suffix is automatically added to this version, to indicate pre-releases and/or dirty builds. The closest variant to wasmtool-py's workflow appears to be https://setuptools-git-versioning.readthedocs.io/en/stable/schemas/file/dev_release_file.html. Example usage, with fictitous version 0.50.0
HEAD (45fd99a) has configured and populated the new
VERSION
file, the revision is untagged, working directory is clean with no untracked files.setuptools-git-versioning generates the version
0.50.0.dev0
, where0.50.0
has been read fromVERSION
dev0
counts the numer of commits sinceVERSION
was modifieddevN
suffix is present because this commit is untaggedTagging this commit indicates a release revision, removing the
devN
suffix.A dirty worktree adds a "local" suffix to the version. Distributions with such a suffix are reject by pypi.org
alexcrichton commentedon Jun 18, 2025
Yeah that seems reasonable to me!
moreati commentedon Jun 18, 2025
PR underway.
Use setuptools-git-versioning for dist versions (e.g. 1.2.3.dev12)
Use setuptools-git-versioning for dist versions (e.g. 1.2.3.dev12)
Use setuptools-git-versioning for dist versions (e.g. 1.2.3.dev12)
Use setuptools-git-versioning for dist versions (e.g. 1.2.3.dev12)
Use setuptools-git-versioning for dist versions (e.g. 1.2.3.dev12) (b…