GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unable to use asdf-vm based version-file · Issue #571 · actions/setup-python

Unable to use asdf-vm based version-file #571

New issue
Copy link
New issue
Copy link
Closed
Closed
Unable to use asdf-vm based version-file#571
Copy link
Assignees
v-mahabaleshwars
Labels
enhancementNew feature or requestNew feature or request

Description

@hjpotter92
hjpotter92
opened on Dec 21, 2022
Issue body actions

I was using setup-node action, and didn't face this problem when using .tool-versions file; so i was surprised hitting this error in setup-python action.

Description:
When using the action, I expected it to work seamlessly with .tool-versions file that asdf-vm generates.

Action version:
Using @v4

Platform:

  • Ubuntu

Runner type:

  • Github's runner

Tools version:

Repro steps:

  • Create a asdf based version file:

    asdf local python 3.10.9
    asdf local poetry 1.3.1
  • Use the generated .tool-versions file in github action:

    - uses: actions/setup-python@v4
      with:
        python-version-file: .tool-versions
        cache: poetry
  • Fails to install python.

Expected behavior:

Parser should be smart to also identify other version managers

Actual behavior:

Resolved architecture/.tool-versions as python 3.10.9
poetry 1.3.1

Version python 3.10.[9](https://github.com/XXXXXXXXXXXXXXXX/actions/runs/3738XXXXXX/jobs/63453738XXXXXX#step:4:10)
poetry 1.3.1
 was not found in the local cache
Error: The version 'python 3.[10](https://github.com/XXXXXXXXXXXXXXXX/actions/runs/3738XXXXXX/jobs/63453738XXXXXX#step:4:11).9
poetry 1.3.1
' with architecture 'x64' was not found for Ubuntu 22.04.
Reacted by David J. Shourabi Porcel, shigwata, Onni Wahlberg, Götz, Kurt von Laven, mwarres, Tanguy Antoine, Evan Peterson, Kyle King, Masashi Tashiro and 5 more

Activity

  1. hjpotter92
    added
    bugSomething isn't workingSomething isn't working
    needs triage
    on Dec 21, 2022
  2. MaksimZhukov
    added
    enhancementNew feature or requestNew feature or request
    and removed
    bugSomething isn't workingSomething isn't working
    needs triage
    on Dec 21, 2022
  3. MaksimZhukov commented on Dec 21, 2022

    @MaksimZhukov
    MaksimZhukov
    on Dec 21, 2022
    Contributor
    More actions

    Hello @hjpotter92 ! Thank you for reporting this!
    We'll consider updating the parsing logic for the python-version-file input.

    Reacted by -, Ray Gesualdo, Tanguy Antoine and Lukasz Bandzarewicz
  4. e-korolevskii
    self-assigned this
    on Jan 18, 2023
  5. dusan-trickovic
    linked a pull request that will close this issueAdd support to .tool-version file format #588on Jul 13, 2023
  6. IvanZosimov
    unassigned
    e-korolevskii
    on Jul 14, 2023
  7. goetzc commented on Oct 3, 2023

    @goetzc
    goetzc
    on Oct 3, 2023
    More actions

    As a workaround you can add a small intermediate step:

        - name: Determine versions
          shell: bash -leo pipefail {0}
          id: get_versions
          run: |
            python="$(grep -v '#' .tool-versions | grep python | awk '{print $2}')"
            echo "python=${python}" >> $GITHUB_OUTPUT
    
        - name: Install Python
          uses: actions/setup-python@v4
          with:
            python-version: ${{ steps.get_versions.outputs.python }}
  8. Kurt-von-Laven commented on Oct 18, 2023

    @Kurt-von-Laven
    Kurt-von-Laven
    on Oct 18, 2023
    Contributor
    More actions

    You can even parse the Python version in a single step:

    python_version="$(grep --perl-regexp --only-matching '(?<=python )(\d+\.){2}\d+' .tool-versions)"
  9. v-mahabaleshwars
    self-assigned this
    on Apr 4, 2025
  10. v-mahabaleshwars commented on Apr 4, 2025

    @v-mahabaleshwars
    v-mahabaleshwars
    on Apr 4, 2025
    Contributor
    More actions

    Hi @hjpotter92,

    We have implemented support for .tool-versions in this PR. Kindly test the changes with the latest version of setup-python.

    We are closing this issue now. Feel free to reach out if you need any further assistance.

  11. v-mahabaleshwars
    closed this as completedon Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @v-mahabaleshwars
    v-mahabaleshwars

Labels

enhancementNew feature or requestNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.