Version via openapi-generator packageVersion (drop setuptools-scm graft)#2
Merged
Conversation
The repo had a half-finished graft: pyproject.toml declared `dynamic = ["version"]` via setuptools-scm to derive the version from git tags, but openapi-generator always regenerates setup.py with a hardcoded `version=VERSION` (= packageVersion). setup.py wins over pyproject's dynamic version, so EVERY publish shipped as 1.0.0 regardless of the tag — PyPI only ever received saturn-api 1.0.0. The 2026.6.2 tag additionally 400'd because a regen reverted packageUrl to a schemeless URL PyPI rejects. Set the repo up the standard openapi-generator way: packageVersion in openapi-generator-config.yaml is the single source of truth, stamped into setup.py / __init__.py / etc. on regen. To release: bump packageVersion, regenerate, push a tag. - openapi-generator-config.yaml: packageVersion 1.0.0 -> 2026.6.3; add https:// to packageUrl (fixes the invalid-URL 400 at the source, for all future regens) - pyproject.toml: static version = "2026.6.3"; drop setuptools-scm from build-requires and remove [tool.setuptools_scm] - setup.py: bump VERSION + add https:// (matches what a regen now produces) Verified: clean `python -m build` produces saturn_api-2026.6.3 with a valid URL, twine check PASSES both artifacts, and a fresh regen stamps the correct version+URL into setup.py. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This repo is fully auto-generated by openapi-generator, but a half-finished change had grafted setuptools-scm onto `pyproject.toml` (`dynamic = ["version"]`, intending "version from git tag"). That doesn't work here: openapi-generator always regenerates `setup.py` with a hardcoded `version=VERSION` (= `packageVersion`), and `setup.py` wins over pyproject's dynamic version.
Consequences:
Fix — set it up the standard openapi-generator way
`packageVersion` in `openapi-generator-config.yaml` is the single source of truth, stamped into `setup.py`/`init.py`/etc. on regen. Releasing = bump `packageVersion`, regenerate, push a tag.
Verification
`2026.6.2` (and `1.0.0`) are burned on PyPI, so the next publish uses `2026.6.3`.
🤖 Generated with Claude Code