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://github.com/raw/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

  1. dmitry-shibanov commented on Oct 25, 2022

    @dmitry-shibanov
    Contributor

    Hello @fregante. Thank you for your report. We'll investigate the feature request.

  2. v-gowridurgad commented on Dec 3, 2024

    @v-gowridurgad
    Contributor

    Hi @fregante, Thank you for your feature request. I noticed that when we specify the version directly in runtime.txt (e.g., 3.10.7), it works correctly. However, using the format python-3.10.7 as specified in the issue results in a failure.
    Additionally, according to the Heroku documentation , runtime.txt is deprecated. Given this deprecation and the fact that direct version specification works, it may not be necessary to pursue this feature request further.
    Thank you for your understanding.

  3. fregante commented on Dec 3, 2024

    @fregante
    Author

    Good to hear! Thanks for the update

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