Skip to content

MAINT: specify py version in setup-python #14615

Backlog

Description

@drammock

I noticed when reviewing #14613 that we're not requesting a specific version of python from actions/setup-python. The action's docs recommend doing so; if you don't provide a with: python-version: X.Y it falls back to a file .python-version, and if that doesn't exist it uses whatever version of python is on the PATH (which for CI runners is not guaranteed to be stable).

Originally posted by @drammock in #14613 (comment)

Activity

  1. larsoner commented on Nov 30, 2026

    @larsoner
    Member

    I kind of prefer it this way actually... things like that should work with any supported Python version really, and by not specifying it we get automatic updates as ubuntu-latest updates. So we have one fewer thing to have to keep updating when we bump minimums (or new Python is released) etc.

  2. drammock commented on Nov 30, 2026

    @drammock
    MemberAuthor

    ok. In the context of #14613, one benefit would be knowing definitively whether the requested python ships with a new enough version of pip, or if we need a python -m pip install --upgrade pip line (and associated time/network traffic). It happens at a few places in the autofix.yml file (in different workflow jobs) and presumably in other workflow files too.

    I guess I'd also counter that our bumping is getting pretty automated, and if we're writing an external .python-version file then the automation doesn't even need to edit the CI workflow definition, so it doesn't seem that onerous to me. But 🤷🏻, I'm not going to die on this hill.

  3. larsoner commented on Nov 30, 2026

    @larsoner
    Member

    Yeah .python-version (or similar) is okay with me. It also would remove the warning in the setup-python action that the version is unspecified and therefore will use the system python version

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