1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-09 21:02:19 +02:00

Add support for .tool-versions file in setup-python (#1043)

* add support for .tool-versions file

* update regex

* optimize code

* update test-python.yml for .tool-versions

* fix format-check errors

* fix formatting in test-python.yml

* Fix test-python.yml error

* workflow update with latest versions

* update test cases

* fix lint issue
This commit is contained in:
mahabaleshwars 2025-03-13 20:51:27 +05:30 committed by GitHub
parent 6fd11e170a
commit 19e4675e06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 193 additions and 6 deletions

View file

@ -245,6 +245,39 @@ jobs:
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'
setup-versions-from-tool-versions-file:
name: Setup ${{ matrix.python }} ${{ matrix.os }} .tool-versions file
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
macos-13,
ubuntu-latest
]
python: [3.13.0, 3.14-dev, pypy3.11-7.3.18, graalpy-24.1.2]
exclude:
- os: windows-latest
python: graalpy-24.1.2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: build-tool-versions-file ${{ matrix.python }}
run: |
echo "python ${{ matrix.python }}" > .tool-versions
- name: setup-python using .tool-versions ${{ matrix.python }}
id: setup-python-tool-versions
uses: ./
with:
python-version-file: .tool-versions
setup-pre-release-version-from-manifest:
name: Setup 3.14.0-alpha.1 ${{ matrix.os }}
runs-on: ${{ matrix.os }}