chore(maintenance): pin Python 3.12 across the docs toolchain - #5648
Open
svozza wants to merge 1 commit into
Open
chore(maintenance): pin Python 3.12 across the docs toolchain#5648svozza wants to merge 1 commit into
svozza wants to merge 1 commit into
Conversation
svozza
force-pushed
the
chore/5647-docs-python-version
branch
from
September 5, 2026 15:40
20ead13 to
8c926f5
Compare
svozza
force-pushed
the
chore/5647-docs-python-version
branch
from
September 5, 2026 15:46
8c926f5 to
9bab029
Compare
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.
Summary
npm run docs:local:setupused whateverpython3the host had, while the docs requirements need Python 3.10 or newer and CI runs 3.12. On an older interpreter the install failed with an opaque pip resolution error, and nothing in the repo recorded the requirement. The Docker path had drifted too: its base image ships Python 3.11, and its exact apk pin for Node no longer exists in the Alpine repository, sonpm run docs:docker:buildfails onmaintoday. This PR pins the interpreter once, indocs/.python-version, and makes CI, the local script, the Docker image and the contributor docs all follow it.Changes
docs/.python-versionpinning3.12. It lives next to the requirements so that pyenv, uv and mise apply it only to the docs toolchain, not to every Python invocation in the checkout.reusable_publish_docs.yml:setup-pythonreads the pin throughpython-version-fileinstead of a hardcoded version, and caches pip downloads keyed ondocs/requirements.txt, matching thecache: npmon the sibling step.docs:local:setupbecomespython$(cut -d. -f1,2 docs/.python-version) -m venv --clear .venv && .venv/bin/pip install --require-hashes -r docs/requirements.txt, deriving the interpreter name from the pin's major and minor so a patch-level value in the file cannot break it. APYTHONenvironment variable overrides the executable for setups that expose the interpreter under another name, such as conda, and the contributor pages say so. A host without that interpreter fails immediately with "command not found" instead of a misleading resolution error;--clearstops a stale venv keeping its old interpreter;--require-hashesgives local installs the same integrity check CI already applies.docs/Dockerfile: base on the digest-pinned officialpython:3.12-alpineimage instead ofsquidfunk/mkdocs-material, and recreate what that image provided: git for the revision-date plugin, Node for TypeDoc, tini as init, the/docsworkdir, themkdocs serveentrypoint, andsafe.directoryfor the mounted checkout. The Node apk pin is dropped; the image digest already fixes the Alpine release, and the exact package pin was what broke the build. pip installs with--no-cache-dirso the wheel cache is not baked into the image..github/dependabot.yml: the docker updater ignores minor and major bumps of thepythonimage so it refreshes the digest without moving the tag away fromdocs/.python-version.docs:local:apiis plaintypedoc, sotypedoc.json'sentryPointsapply instead of a positional.that hits the walk-root problem below.mkdocs.yml: the typedoc plugin'ssourceispackages/*instead of.. Inpackagesmode TypeDoc walks from the parent of the entry point, and for a repo mounted at/docsthat parent is/, where its path handling matches nothing.packages/*gives it a walk root ofpackages, matches theentryPointsintypedoc.json, and documents the same fourteen packages.CONTRIBUTING.mdanddocs/contributing/setup.mdname the pin file as the prerequisite for the non-Docker path instead of "Python 3.x".Verified:
mkdocs buildon the host and inside the new image both exit 0 with zero TypeDoc errors and the same 134 API module pages; the setup script builds a 3.12 venv with a working mkdocs where Python 3.12 is available and fails withpython3.12: command not foundwhere it is not; actionlint, markdownlint and Biome pass.Issue number: closes #5647
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.