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 #571DescriptionI 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:
Runner type:
Tools version:
Repro steps:
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 ActivityMaksimZhukov commented on Dec 21, 2022 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 goetzc commented on Oct 3, 2023 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 }}Kurt-von-Laven commented on Oct 18, 2023 You can even parse the Python version in a single step:
python_version="$(grep --perl-regexp --only-matching '(?<=python )(\d+\.){2}\d+' .tool-versions)"v-mahabaleshwars commented on Apr 4, 2025 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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|