Skip to content

Carry a Fleet Default Python Line in .python-version and Let CI Read Each Repository's Own #4187

Done

Description

@ptr727

Bring Python onto the toolchain-version model CODESTYLE.md "Toolchain Versions" states, the one .NET now follows through global.json and repoOwnedKeys. That means a fleet default in one carried baseline file, a selector each repository owns, and hub tooling that reads the selector and falls back to the default.

Decisions already made

  • The selector is a root .python-version naming X.Y. uv, setup-python, and pyenv read it natively, and uv fetches that interpreter on a developer host.
  • The fleet default is 3.14.
  • The hub tooling's own interpreter stays separate and hub-owned. That is the 3.13 floor in spec/host-tools.json, the PEP 723 headers, and the job-wide setup-uv in validate-task.yml's lint job.

Where things stand

  • Nothing sets a fleet Python default. 3.13 is typed by hand in about thirteen places, and the Python devcontainer snippet already says 3.14.
  • A repository's own files never steer CI. setup-uv's python-version sets UV_PYTHON, which beats uv's discovery. The only override is the caller's with: python-versions.
  • pypi-build-default uses discovery, so a release can build on a different interpreter from the one validate tested.

Plan

  1. Carry catalog/snippets/configs/.python-version holding 3.14. Declare it in spec/files.json at intent fidelity for python repositories, with the whole value repository-owned. Add it to the Python type's requiredFiles.
  2. Add .github/actions/python-version/action.yml, modelled on dotnet-sdk's selection step. It reads the caller's root .python-version and falls back to 3.14 with a warning. A test holds the fallback to the snippet, as tests/sdk_baseline.py does for .NET.
  3. In validate-task.yml, default python-versions to empty, meaning the caller's selector. An explicit input still wins over the file, and the file over the fallback. The test-matrix job needs a sparse checkout of .python-version to resolve it.
  4. Pass the resolved version to setup-uv in pypi-build-default, so a release builds on the interpreter validate tested.
  5. Derived settings in the Python rule text:
    • A build-profile project's requires-python floor equals the .python-version minor.
    • ruff target-version, mypy python_version, and pyright pythonVersion stay unset there.
    • A lint-only tree, having no [project], sets all three explicitly.
    • A letter check python.version.consistent holds them, the devcontainer tag, and any explicit python-versions entry to the selector.
  6. Document the devcontainer tag as repository-owned. A repository's own line comes from uv on the host, so the Windows installer keeps installing only the tooling floor.

Rollout note

Until a repository carries .python-version, CI falls back to 3.14. That moves every caller passing no python-versions from 3.13 to 3.14, which the release notes should state.

Activity

  1. ptr727 commented on Nov 26, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-25): this group merged into develop as #4472 and its branch and worktree were cleaned up, so the claim holds no files.

    Backlog burndown claim (away run 2026-11-25, round 2, refill queue 4, dispatched 2026-11-26 as the round's eighth group): branch burndown/python-version-selector, issue #4187, its plan as the body's "Decisions already made" settle it. This one issue predicts more than four files, so it is a group by itself.

    Predicted files:

    • catalog/snippets/configs/.python-version (new, 3.14), spec/files.json (intent fidelity, whole value repository-owned, python only), and spec/project-types.json (the Python type's requiredFiles) (plan step 1).
    • .python-version at the hub root (new, 3.13), only where the hub's own audit or CI needs a selector. The body keeps the hub tooling's interpreter on 3.13, so the hub's own pytest leg stays there rather than falling back to 3.14.
    • .github/actions/python-version/action.yml (new) and its fallback test, a new test file or tests/test_release_guards.py beside the tests/sdk_baseline.py use (step 2).
    • .github/workflows/validate-task.yml, tests/test_workflow_steps.py, and tests/test_release_guards.py, which asserts the python-versions declaration and default (step 3).
    • .github/actions/pypi-build-default/action.yml (step 4).
    • CODESTYLE.md ("Toolchain Versions" and the Python section), .agents/skills/python-codestyle/SKILL.md, and .agents/skills/python-codestyle/references/code-style.md, the derived settings in the Python rule text (step 5).
    • docs/reusable-workflows.md, only where it states the python-versions default (["3.13"]) and how the leg's interpreter is chosen.
    • docs/devcontainer.md, only where step 6 documents the Python devcontainer tag as repository-owned.
    • The python.version.consistent letter check (spec/checks.json, spec/project-types.json, a module and test beside the other spec/audit_*.py), only where it fits outside spec/audit.py (2988 of its 3000-line ceiling, not raised). Otherwise that part stays open on this issue and the pull request carries no closing line.

    The generated .github/skills/ and .claude-plugin/ copies follow the skill edits and are not counted.

    Not claimed: GOVERNANCE.md (held by #1116) and WORKFLOW.md (held by #4377), neither of which states the Python default. docs/reusable-workflows.md was passed from #4377 to the #3940 group, which merged, and #4377 holds no commits. .github/workflows/test-pull-request.yml and publish-release.yml are free, and are claimed by extending this comment only if the root selector does not suffice.

    Dispatched: groups D2 (claimed on #3325) and C2 (claimed on #1783) merged and released validate-task.yml and spec/files.json. No other live claim or open feature pull request holds any of these files.

    Any other group needing one of these files waits for this branch to merge.

    Extended (2026-11-25, orchestrator): .github/workflows/build-release-task.yml, a select-Python-version step in the build-pypi job feeding a new python-version input on pypi-build-default. No other group holds it.

  2. ptr727 commented on Nov 26, 2026

    @ptr727
    OwnerAuthor

    State from the backlog burndown group working this issue (branch burndown/python-version-selector, pull request #4472 into develop, worktree left standing).

    Landing in #4472, the part of the plan that needs no decision:

    • .github/actions/python-version reads a caller's root .python-version. With no file it falls back to 3.14 with a warning, and a file naming no X.Y line fails it (plan step 2).
    • validate-task.yml defaults python-versions to empty. The precedence is the input, then the file, then the fallback. The test-matrix job sparse-checks out the file (plan step 3).
    • The release task passes the line a .python-version selects to pypi-build-default (plan step 4). With no file, uv chooses as before, since the release cannot see validate's python-versions input.
    • The derived settings are stated in the Python rule text. python.version.consistent lands as a by-hand letter check that applies where the file is present (plan step 5).
    • The devcontainer tag is documented as repository-owned (plan step 6).
    • The hub carries a root .python-version of 3.13.

    Still open here, the carried-unit part of plan step 1. That is the spec/files.json unit, the catalog/snippets/configs/.python-version snippet, and the Python type's requiredFiles entry. The plan asks for intent fidelity and for the whole value to be repository-owned, and the audit engine cannot express both. #4471 asks the maintainer which gives way. #4472 therefore carries no closing line for this issue.

  3. ptr727 commented on Nov 26, 2026

    @ptr727
    OwnerAuthor

    Decision #4471 is answered (option 1, presence fidelity with a reference snippet). The carried-unit part of this issue can proceed.

  4. ptr727 commented on Nov 27, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-27): PR #4526 merged into develop as 0d206788, and its branch and worktree are cleaned up, so this claim holds no files.

    Backlog burndown claim (away run 2026-11-27, round 1, group 8): branch burndown/python-version-carried-unit, issues #4187 (its carried-unit part, plan step 1) and #4471 (the answered question it waited on), per the maintainer's 2026-11-26 answer on #4471 (option 1): presence fidelity with a reference snippet, following the Docker/README.md precedent, with no engine change.

    Predicted files:

    • catalog/snippets/configs/.python-version (new), holding 3.14.
    • spec/files.json: { "path": ".python-version", "reference": "catalog/snippets/configs/.python-version", "appliesTo": ["python"] }, with no fidelity.
    • spec/project-types.json: .python-version in the Python type's requiredFiles.
    • spec/validate.py: a CARRIED_PATH_PINS line for the path.
    • tests/test_spec_validate.py: only where a pinned case needs the new path.

    This group predicts more than four files, so it is a group by itself. Any other group needing one of these files waits for this branch to merge.

    Grown set granted (2026-11-27, away run round 1, group G8): tests/test_release_guards.py, only PythonVersionLineCase, to hold the python-version action fallback equal to the new carried snippet. No open pull request or other claim touches it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions