Skip to content

Improve UsePython to allow installation versions on-flight  #13319

Closed

Description

Problem

Currently, UsePython task just switches versions that are pre-cached on image (example).

It works for the most of the use-cases, because image always contains latest patch version for every major.minor pair.
However, some customers prefer to specify exact version of Python and would like to control it by themselves / freeze specific version. Current implementation of UsePython doesn't allow it.

Proposal

Versions of Python can be installed on-flight from https://github.com/actions/python-versions. This repo distributes versions of Python via GH releases. Also it contains versions-manifest.json as an index of versions.

Installation on-flight is pretty quick and should cover those use-cases. Also it is not a breaking change because task will try to download version only in case if it is not found locally.

The same changes were already done for GitHub Actions task setup-python.
Related PRs:

  1. Use GitHub releases to download python versions actions/setup-python#85
  2. Tool cache install from a manifest file actions/toolkit#382

Activity

  1. mattip commented on Aug 6, 2020

    @mattip

    This would be very useful for trying out versions of python without waiting for deployment of a new image.

  2. remyjette commented on Oct 8, 2020

    @remyjette
    Member

    This would also be really nice for self-hosted agents

    For example NuGetToolInstaller@1 will "find, download, and cache a specified version of NuGet." Very easy to use. But UsePythonVersion@0 instead has a whole section in the documentation "How can I configure a self-hosted agent to use this task?" which describes a manual process for setting up a very specific folder structure inside _work/_tool, which then needs to be performed again for each new version.

  3. github-actions commented on May 27, 2021

    @github-actions

    This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

  4. hugovk commented on May 28, 2021

    @hugovk

    Still valid. Would be nice to have this in place for the Python 3.10 release in October.

  5. 17 remaining items

  6. github-actions commented on Sep 1, 2023

    @github-actions

    This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

  7. hugovk commented on Sep 1, 2023

    @hugovk

    Would be nice for confirmation for the Python 3.12 release in October 2023.

  8. github-actions commented on Feb 28, 2024

    @github-actions

    This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

  9. hugovk commented on Feb 28, 2024

    @hugovk

    Would be nice for confirmation for the Python 3.13 release in October 2024.

  10. github-actions commented on Apr 10, 2025

    @github-actions

    This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

  11. hugovk commented on Apr 10, 2025

    @hugovk

    Would be nice for confirmation for the Python 3.14 release in October 2025.

  12. github-actions commented on Oct 7, 2025

    @github-actions

    This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions