Skip to content

Version via openapi-generator packageVersion (drop setuptools-scm graft)#2

Merged
hhuuggoo merged 1 commit into
mainfrom
hugo/native-packageversion
Jun 3, 2026
Merged

Version via openapi-generator packageVersion (drop setuptools-scm graft)#2
hhuuggoo merged 1 commit into
mainfrom
hugo/native-packageversion

Conversation

@hhuuggoo

@hhuuggoo hhuuggoo commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

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:

  • Every publish shipped as `1.0.0` regardless of the tag — PyPI only ever received `saturn-api 1.0.0`. The git-tag versioning never actually took effect.
  • The `2026.6.2` publish additionally 400'd (`'github.com/saturncloud/saturn-api' is not a valid url`) because a regen reverted `packageUrl` to a schemeless URL.

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.

  • 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; remove `[tool.setuptools_scm]`
  • setup.py: bump `VERSION` + add `https://` (matches what a regen now produces)

Verification

  • Clean `python -m build` → `saturn_api-2026.6.3` (was `1.0.0`) with a valid `Home-page` URL
  • `twine check` PASSES both wheel and sdist
  • A fresh `openapi-generator-cli generate` from the updated config stamps `VERSION = "2026.6.3"` and the `https://` URL into `setup.py` — so the config genuinely drives everything; no need to ignore `setup.py`

`2026.6.2` (and `1.0.0`) are burned on PyPI, so the next publish uses `2026.6.3`.

🤖 Generated with Claude Code

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>
@hhuuggoo hhuuggoo merged commit de3fbae into main Jun 3, 2026
10 checks passed
@hhuuggoo hhuuggoo deleted the hugo/native-packageversion branch June 3, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant