From a62576618eeb7d041975de39c4313b0426940f35 Mon Sep 17 00:00:00 2001 From: hugo Date: Wed, 3 Jun 2026 17:04:12 +0000 Subject: [PATCH] Version via openapi-generator packageVersion, not setuptools-scm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- openapi-generator-config.yaml | 4 ++-- pyproject.toml | 10 ++++++---- setup.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/openapi-generator-config.yaml b/openapi-generator-config.yaml index 9f1978f..b603d9f 100644 --- a/openapi-generator-config.yaml +++ b/openapi-generator-config.yaml @@ -1,5 +1,5 @@ projectName: saturn-api packageName: saturn_api -packageUrl: github.com/saturncloud/saturn-api -packageVersion: 1.0.0 +packageUrl: https://github.com/saturncloud/saturn-api +packageVersion: 2026.6.3 library: httpx diff --git a/pyproject.toml b/pyproject.toml index 7327e09..392c194 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,10 @@ [project] name = "saturn_api" -dynamic = ["version"] +# Version is set by openapi-generator from `packageVersion` in +# openapi-generator-config.yaml. Bump it there and regenerate to release a new +# version; keep this value in sync (the generator stamps it across setup.py, +# saturn_api/__init__.py, etc.). +version = "2026.6.3" description = "Saturn Cloud" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, @@ -34,11 +38,9 @@ mypy = ">= 1.5" [build-system] -requires = ["setuptools>=61", "setuptools-scm>=8"] +requires = ["setuptools>=61"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] - [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" diff --git a/setup.py b/setup.py index 19c68a0..20968a7 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "saturn-api" -VERSION = "1.0.0" +VERSION = "2026.6.3" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "python-dateutil >= 2.8.2", @@ -33,7 +33,7 @@ description="Saturn Cloud", author="OpenAPI Generator community", author_email="team@openapitools.org", - url="github.com/saturncloud/saturn-api", + url="https://github.com/saturncloud/saturn-api", keywords=["OpenAPI", "OpenAPI-Generator", "Saturn Cloud"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]),