Skip to content

Support reading the version from from runtime.txtΒ #530

Description

@fregante

Description:
#336 added support for .python-version, which is used by pyenv.

- uses: actions/setup-python@v4
  with:
    python-version-file: runtime.txt # ❌ fail πŸ‘‡ 
Resolved runtime.txt as python-3.10.7

Version python-3.10.7
 was not found in the local cache
Error: Version python-3.10.7
 with arch x64 not found
The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Justification:
Runtime.txt is used by Heroku and more tools and it's not a raw version file like .python-version, it looks more like:

python-3.10.7

Dependabot also seems to explicitly support runtime.txt

More details: https://devcenter.heroku.com/articles/python-runtimes

My current solution involves manually parsing the file with an extra step:

      - name: Parse Python version
        run: sed  s/python-// runtime.txt | head > .python-version
      - uses: actions/setup-python@v4
        with:
          cache: pip

Activity

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

Metadata

Metadata

Assignees

Labels

feature requestNew feature or request to improve the current logicneeds eyes

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions