actions / actions/setup-python

Allow specifying a minimum version

Open
#1,131 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
TypeScript
Stars
2.2k
Forks
739
Avg merge
6d 18h
Merged PRs (30d)
1

Description

Description:
I've written a utility script in Python for some of our internal reusable workflows, and it depends on some features added in 3.13. Currently on ubuntu-latest 3.12 is the default version, but 3.13 is available in the tool cache. This means that I can add a setup-python step in my composite action that will activate 3.13. However at some point in the future, 3.13 will become the default, then 3.14, and etc etc. When 3.14 is the default, I'm fine using 3.14 for my script. However my action will continue to be pinned to 3.13, downgrading the version of Python.

It would be nice to specify a minimum version (in my case 3.13). If the default version is less than the minimum version, it would do as it does now and activate (or download if it's not in the tool cache) version 3.13. If the default version is 3.13 or greater, it would simply not do anything.

Justification:
Python is useful for writing small glue scripts in workflows where the full capabilities of python version management aren't required, but it would be nice to be able to automatically use this action to ensure a minimum version is present on the runner, to enable these glue scripts to run easily without a lot of effort on the person building the workflow.

Are you willing to submit a PR?
Given some guidance on the flow of the existing code, I could potentially be able to work on adding this functionality myself.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the setup-python step and its interaction with the runner's tool cache, focusing on how the default Python version is selected. Done means a minimum version can be requested, older defaults activate or download that version, and newer defaults are left unchanged; add coverage for both cases if the existing test flow supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python, typescript
Domain
ci-cd, devops, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.