From 0f8cab9cd940fc45c0f017b2cf1b0bc89298d1e6 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Thu, 1 Oct 2026 11:43:31 +0200 Subject: [PATCH 1/2] NMV-1168: support Python 3.14+ and fix the sdist `pip install nextroute` failed on Python 3.14: no wheel matched, so pip fell back to the sdist, which cannot be built by anyone. Emit `py3-none-` wheels instead of `cp3XX-cp3XX-`. The package has no C extension - it is pure Python plus a bundled Go binary invoked as a subprocess - so the interpreter tag was never meaningful. A single wheel per platform now covers every Python, including versions released long after the wheel was built: verified by installing one wheel on 3.10 through 3.15 and solving identically on all six. Because of that, `requires-python` keeps its `>=3.10` floor and deliberately gains no upper bound. A newly released interpreter finds a matching wheel and just works, with no release, classifier change or build-matrix change on our side. The classifiers list what CI exercises; newer versions are expected to work and are not blocked. Also fix two long-standing sdist problems: a source build now fails with an actionable message naming the real prerequisites rather than a bare FileNotFoundError, and the 15 MB platform-specific Go binary is no longer shipped inside the sdist (7.9 MB -> 26 KB). Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/python-test.yml | 2 +- MANIFEST.in | 5 +++++ pyproject.toml | 17 +++++++++++++++- setup.py | 33 +++++++++++++++++++++++++++++-- 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 MANIFEST.in diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index fdf27eea..8607f2f0 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.13"] + python-version: ["3.10", "3.13", "3.14"] platform: [ ubuntu-latest, diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..e8f9774b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +# The Nextroute binary is a build artifact. It belongs in the wheels, but must +# never be shipped inside the source distribution: it is platform-specific, it +# adds ~15 MB, and whichever platform happened to build the sdist would leak its +# own binary to everyone else. +prune src/nextroute/bin diff --git a/pyproject.toml b/pyproject.toml index c3d63955..fc8142a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ "pydantic>=2.5.2", @@ -38,6 +39,15 @@ maintainers = [ ] name = "nextroute" readme = "README.md" +# Intentionally no upper bound. The wheels are tagged py3-none- (see +# get_tag in setup.py), so a newly released interpreter still finds a matching +# wheel and keeps working without a new release from us. The package is pure +# Python plus a bundled Go binary invoked as a subprocess: it has no C extension +# and imports nothing beyond pydantic and long-stable stdlib modules, so there is +# nothing here that tracks the interpreter version. The classifiers below list +# the versions we actually exercise in CI; newer ones are expected to work and +# are not blocked. Only add an upper bound if a specific Python release is known +# to break us - in that case cap it at that version and say which one here. requires-python = ">=3.10" [project.urls] @@ -72,7 +82,12 @@ nextroute = ["bin/*.exe"] [tool.cibuildwheel] test-command = 'python -c "exec(\"import nextroute\nprint(nextroute.nextroute_version())\")"' -build = "cp3{10,11,12,13}-*" +# The wheels are tagged py3-none- (see get_tag in setup.py), so one +# build per platform covers every supported Python. Building more than one +# interpreter per platform would just produce the same wheel repeatedly. We build +# on the oldest supported Python so the emitted wheel cannot accidentally depend +# on a newer interpreter. +build = "cp310-*" skip = "*musllinux*" archs = "native" manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64" diff --git a/setup.py b/setup.py index b7042fce..90891b89 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ import os import platform +import shutil import subprocess from setuptools import Distribution, setup @@ -16,7 +17,13 @@ def finalize_options(self): def get_tag(self): python, abi, plat = _bdist_wheel.get_tag(self) - # python, abi = "py3", "none" + # The wheel bundles a prebuilt Go binary but contains no C + # extension, so it is platform-specific while being independent of + # the interpreter version. Tagging it py3-none- instead of + # cp3XX-cp3XX- means a single wheel per platform serves + # every Python we support, including versions released after this + # wheel was built. + python, abi = "py3", "none" return python, abi, plat class MyDistribution(Distribution): @@ -59,9 +66,31 @@ def has_ext_modules(self): raise Exception(f"unsupported architecture: {goarch}") # Compile the binary. +standalone_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "cmd") + +# The Go sources are deliberately not part of the source distribution, so a +# build from the sdist cannot work. Fail with an explanation rather than with a +# bare FileNotFoundError from the chdir below. +if not os.path.isdir(standalone_dir): + raise Exception( + "cannot build nextroute from source: the Go sources required to compile " + "the Nextroute binary are not shipped in the source distribution. " + "Install one of the prebuilt wheels instead. If no wheel matches your " + "platform or Python version, build from a clone of " + "https://github.com/nextmv-io/nextroute." + ) + +# Building also needs a Go toolchain, which cannot be expressed in +# build-system.requires, so check for it up front. +if shutil.which("go") is None: + raise Exception( + "cannot build nextroute from source: the Go toolchain is required to " + "compile the Nextroute binary but `go` was not found on PATH. Install Go " + "(https://go.dev/dl/), or install one of the prebuilt wheels instead." + ) + print(f"Compiling Nextroute binary for {goos} {goarch}...") cwd = os.getcwd() -standalone_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "cmd") os.chdir(standalone_dir) call = ["go", "build", "-o", "../src/nextroute/bin/nextroute.exe", "."] From 772d41cf1424f9e0b9b1808c930f7e832b992cfd Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Thu, 1 Oct 2026 17:37:32 +0200 Subject: [PATCH 2/2] Bump version to v1.13.0-dev.0 Pre-release for testing the py3-none wheel retagging and the widened Python support. Minor rather than patch: the wheel filenames change shape (cp3XX-cp3XX- -> py3-none-), which is visible to anyone mirroring, vendoring or pinning artifacts, and support for Python 3.14+ is new functionality rather than a fix. Co-Authored-By: Claude Opus 5 (1M context) --- VERSION | 2 +- src/nextroute/__about__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 89390468..57d881b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.12.7 +v1.13.0-dev.0 diff --git a/src/nextroute/__about__.py b/src/nextroute/__about__.py index 19ed4a44..681ba4d8 100644 --- a/src/nextroute/__about__.py +++ b/src/nextroute/__about__.py @@ -1,2 +1,2 @@ # © 2019-present nextmv.io inc -__version__ = "v1.12.7" +__version__ = "v1.13.0-dev.0"