mirror of
https://github.com/actions/setup-python.git
synced 2026-01-09 09:38:18 +00:00
Compare commits
5 Commits
4224126dd3
...
v6.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e797f83bcb | ||
|
|
3d1e2d2ca0 | ||
|
|
65b071217a | ||
|
|
5b668cf765 | ||
|
|
f62a0e252f |
2
.github/workflows/basic-validation.yml
vendored
2
.github/workflows/basic-validation.yml
vendored
@@ -14,4 +14,4 @@ jobs:
|
|||||||
name: Basic validation
|
name: Basic validation
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '24.x'
|
||||||
|
|||||||
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@@ -16,4 +16,4 @@ jobs:
|
|||||||
name: Check dist/
|
name: Check dist/
|
||||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '24.x'
|
||||||
|
|||||||
14
.github/workflows/e2e-cache-freethreaded.yml
vendored
14
.github/workflows/e2e-cache-freethreaded.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
id: cache-pipenv
|
id: cache-pipenv
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.0, 3.13.1, 3.13.2]
|
python-version: [3.13.0, 3.13.1, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Install poetry
|
- name: Install poetry
|
||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
- name: Init pyproject.toml
|
- name: Init pyproject.toml
|
||||||
@@ -122,7 +122,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -150,7 +150,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
id: cache-pipenv
|
id: cache-pipenv
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -181,7 +181,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -209,7 +209,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
14
.github/workflows/e2e-cache.yml
vendored
14
.github/workflows/e2e-cache.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: pypy-3.11-v7.x
|
python-version: pypy-3.11-v7.x
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
- os: ubuntu-22.04-arm
|
- os: ubuntu-22.04-arm
|
||||||
python-version: pypy-3.10-v7.x
|
python-version: pypy-3.10-v7.x
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
id: cache-pipenv
|
id: cache-pipenv
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -140,7 +140,7 @@ jobs:
|
|||||||
'3.13'
|
'3.13'
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Install poetry
|
- name: Install poetry
|
||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
- name: Init pyproject.toml
|
- name: Init pyproject.toml
|
||||||
@@ -184,7 +184,7 @@ jobs:
|
|||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: pypy-3.11-v7.x
|
python-version: pypy-3.11-v7.x
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -222,7 +222,7 @@ jobs:
|
|||||||
- os: ubuntu-22.04-arm
|
- os: ubuntu-22.04-arm
|
||||||
python-version: pypy-3.11-v7.x
|
python-version: pypy-3.11-v7.x
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
id: cache-pipenv
|
id: cache-pipenv
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -268,7 +268,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -296,7 +296,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/e2e-tests.yml
vendored
2
.github/workflows/e2e-tests.yml
vendored
@@ -29,7 +29,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Run with setup-python 3.9.13
|
- name: Run with setup-python 3.9.13
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out
|
- name: Checking out
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Publish
|
- name: Publish
|
||||||
id: publish
|
id: publish
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
|||||||
6
.github/workflows/test-graalpy.yml
vendored
6
.github/workflows/test-graalpy.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.graalpy }}
|
- name: setup-python ${{ matrix.graalpy }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.graalpy }}
|
- name: setup-python ${{ matrix.graalpy }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, macos-13]
|
os: [ubuntu-latest, macos-latest, macos-13]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup GraalPy and check latest
|
- name: Setup GraalPy and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
id: graalpy
|
id: graalpy
|
||||||
|
|||||||
10
.github/workflows/test-pypy.yml
vendored
10
.github/workflows/test-pypy.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
- name: setup-python ${{ matrix.pypy }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
- name: setup-python ${{ matrix.pypy }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -150,7 +150,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.pypy }}
|
- name: setup-python ${{ matrix.pypy }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -181,7 +181,7 @@ jobs:
|
|||||||
macos-13
|
macos-13
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup PyPy and check latest
|
- name: Setup PyPy and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -223,7 +223,7 @@ jobs:
|
|||||||
macos-13
|
macos-13
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup PyPy and check latest
|
- name: Setup PyPy and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
30
.github/workflows/test-python-freethreaded.yml
vendored
30
.github/workflows/test-python-freethreaded.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
run: echo ${{ matrix.python }} > .python-version
|
||||||
@@ -110,7 +110,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
run: echo ${{ matrix.python }} > .python-version
|
||||||
@@ -148,7 +148,7 @@ jobs:
|
|||||||
python: [3.13.0, 3.13.1, 3.13.2]
|
python: [3.13.0, 3.13.1, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -189,7 +189,7 @@ jobs:
|
|||||||
python: [3.13.0, 3.13.1, 3.13.2]
|
python: [3.13.0, 3.13.1, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -230,7 +230,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-tool-versions-file ${{ matrix.python }}
|
- name: build-tool-versions-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -261,7 +261,7 @@ jobs:
|
|||||||
python: [3.13t, 3.14t-dev]
|
python: [3.13t, 3.14t-dev]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -301,7 +301,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -340,7 +340,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14.0-alpha.6
|
- name: setup-python 3.14.0-alpha.6
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -377,7 +377,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14t-dev
|
- name: setup-python 3.14t-dev
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -414,7 +414,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14t
|
- name: setup-python 3.14t
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -453,7 +453,7 @@ jobs:
|
|||||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -485,7 +485,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: [3.13t, 3.14t-dev]
|
python-version: [3.13t, 3.14t-dev]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python and check latest
|
- name: Setup Python and check latest
|
||||||
id: setup-python
|
id: setup-python
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -511,7 +511,7 @@ jobs:
|
|||||||
macos-13
|
macos-13
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python and check latest
|
- name: Setup Python and check latest
|
||||||
id: setup-python
|
id: setup-python
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -542,7 +542,7 @@ jobs:
|
|||||||
python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6]
|
python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
uses: ./
|
uses: ./
|
||||||
|
|||||||
28
.github/workflows/test-python.yml
vendored
28
.github/workflows/test-python.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
run: echo ${{ matrix.python }} > .python-version
|
||||||
@@ -124,7 +124,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: echo ${{ matrix.python }} > .python-version
|
run: echo ${{ matrix.python }} > .python-version
|
||||||
@@ -169,7 +169,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, '==3.12.3', 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, '==3.12.3', 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -219,7 +219,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -272,7 +272,7 @@ jobs:
|
|||||||
python: graalpy-24.1.2
|
python: graalpy-24.1.2
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-tool-versions-file ${{ matrix.python }}
|
- name: build-tool-versions-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -303,7 +303,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -353,7 +353,7 @@ jobs:
|
|||||||
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: build-version-file ${{ matrix.python }}
|
- name: build-version-file ${{ matrix.python }}
|
||||||
run: |
|
run: |
|
||||||
@@ -402,7 +402,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14.0-alpha.6
|
- name: setup-python 3.14.0-alpha.6
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -445,7 +445,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14-dev
|
- name: setup-python 3.14-dev
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -482,7 +482,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python 3.14
|
- name: setup-python 3.14
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -521,7 +521,7 @@ jobs:
|
|||||||
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: setup-python ${{ matrix.python }}
|
- name: setup-python ${{ matrix.python }}
|
||||||
id: setup-python
|
id: setup-python
|
||||||
@@ -553,7 +553,7 @@ jobs:
|
|||||||
]
|
]
|
||||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python and check latest
|
- name: Setup Python and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -585,7 +585,7 @@ jobs:
|
|||||||
macos-13
|
macos-13
|
||||||
]
|
]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Python and check latest
|
- name: Setup Python and check latest
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.licenses/npm/@types/node.dep.yml
generated
2
.licenses/npm/@types/node.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@types/node"
|
name: "@types/node"
|
||||||
version: 20.11.25
|
version: 24.1.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: TypeScript definitions for node
|
summary: TypeScript definitions for node
|
||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
||||||
|
|||||||
2
.licenses/npm/undici-types.dep.yml
generated
2
.licenses/npm/undici-types.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: undici-types
|
name: undici-types
|
||||||
version: 5.26.5
|
version: 7.8.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: A stand-alone types package for Undici
|
summary: A stand-alone types package for Undici
|
||||||
homepage: https://undici.nodejs.org
|
homepage: https://undici.nodejs.org
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -18,8 +18,8 @@ See [action.yml](action.yml)
|
|||||||
**Python**
|
**Python**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -28,8 +28,8 @@ steps:
|
|||||||
**PyPy**
|
**PyPy**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: 'pypy3.10'
|
python-version: 'pypy3.10'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -38,8 +38,8 @@ steps:
|
|||||||
**GraalPy**
|
**GraalPy**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: 'graalpy-24.0'
|
python-version: 'graalpy-24.0'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -48,8 +48,8 @@ steps:
|
|||||||
**Free threaded Python**
|
**Free threaded Python**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13t'
|
python-version: '3.13t'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -83,8 +83,8 @@ The action defaults to searching for a dependency file (`requirements.txt` or `p
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import {cacheDependencies} from '../src/setup-python';
|
|
||||||
import {getCacheDistributor} from '../src/cache-distributions/cache-factory';
|
|
||||||
|
|
||||||
jest.mock('fs', () => {
|
|
||||||
const actualFs = jest.requireActual('fs');
|
|
||||||
return {
|
|
||||||
...actualFs,
|
|
||||||
promises: {
|
|
||||||
access: jest.fn(),
|
|
||||||
mkdir: jest.fn(),
|
|
||||||
copyFile: jest.fn(),
|
|
||||||
writeFile: jest.fn(),
|
|
||||||
appendFile: jest.fn()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
jest.mock('@actions/core');
|
|
||||||
jest.mock('../src/cache-distributions/cache-factory');
|
|
||||||
|
|
||||||
const mockedFsPromises = fs.promises as jest.Mocked<typeof fs.promises>;
|
|
||||||
const mockedCore = core as jest.Mocked<typeof core>;
|
|
||||||
const mockedGetCacheDistributor = getCacheDistributor as jest.Mock;
|
|
||||||
|
|
||||||
describe('cacheDependencies', () => {
|
|
||||||
const mockRestoreCache = jest.fn();
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
jest.clearAllMocks();
|
|
||||||
process.env.GITHUB_ACTION_PATH = '/github/action';
|
|
||||||
process.env.GITHUB_WORKSPACE = '/github/workspace';
|
|
||||||
|
|
||||||
mockedCore.getInput.mockReturnValue('nested/deps.lock');
|
|
||||||
|
|
||||||
// Simulate file exists by resolving access without error
|
|
||||||
mockedFsPromises.access.mockImplementation(async p => {
|
|
||||||
const pathStr = typeof p === 'string' ? p : p.toString();
|
|
||||||
if (pathStr === '/github/action/nested/deps.lock') {
|
|
||||||
return Promise.resolve();
|
|
||||||
}
|
|
||||||
// Simulate directory doesn't exist to test mkdir
|
|
||||||
if (pathStr === path.dirname('/github/workspace/nested/deps.lock')) {
|
|
||||||
return Promise.reject(new Error('no dir'));
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Simulate mkdir success
|
|
||||||
mockedFsPromises.mkdir.mockResolvedValue(undefined);
|
|
||||||
|
|
||||||
// Simulate copyFile success
|
|
||||||
mockedFsPromises.copyFile.mockResolvedValue(undefined);
|
|
||||||
|
|
||||||
mockedGetCacheDistributor.mockReturnValue({restoreCache: mockRestoreCache});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('copies the dependency file and resolves the path with directory structure', async () => {
|
|
||||||
await cacheDependencies('pip', '3.12');
|
|
||||||
|
|
||||||
const sourcePath = path.resolve('/github/action', 'nested/deps.lock');
|
|
||||||
const targetPath = path.resolve('/github/workspace', 'nested/deps.lock');
|
|
||||||
|
|
||||||
expect(mockedFsPromises.access).toHaveBeenCalledWith(
|
|
||||||
sourcePath,
|
|
||||||
fs.constants.F_OK
|
|
||||||
);
|
|
||||||
expect(mockedFsPromises.mkdir).toHaveBeenCalledWith(
|
|
||||||
path.dirname(targetPath),
|
|
||||||
{
|
|
||||||
recursive: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
expect(mockedFsPromises.copyFile).toHaveBeenCalledWith(
|
|
||||||
sourcePath,
|
|
||||||
targetPath
|
|
||||||
);
|
|
||||||
expect(mockedCore.info).toHaveBeenCalledWith(
|
|
||||||
`Copied ${sourcePath} to ${targetPath}`
|
|
||||||
);
|
|
||||||
expect(mockedCore.info).toHaveBeenCalledWith(
|
|
||||||
`Resolved cache-dependency-path: nested/deps.lock`
|
|
||||||
);
|
|
||||||
expect(mockRestoreCache).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('warns if the dependency file does not exist', async () => {
|
|
||||||
// Simulate file does not exist by rejecting access
|
|
||||||
mockedFsPromises.access.mockRejectedValue(new Error('file not found'));
|
|
||||||
|
|
||||||
await cacheDependencies('pip', '3.12');
|
|
||||||
|
|
||||||
expect(mockedCore.warning).toHaveBeenCalledWith(
|
|
||||||
expect.stringContaining('does not exist')
|
|
||||||
);
|
|
||||||
expect(mockedFsPromises.copyFile).not.toHaveBeenCalled();
|
|
||||||
expect(mockRestoreCache).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('warns if file copy fails', async () => {
|
|
||||||
// Simulate copyFile failure
|
|
||||||
mockedFsPromises.copyFile.mockRejectedValue(new Error('copy failed'));
|
|
||||||
|
|
||||||
await cacheDependencies('pip', '3.12');
|
|
||||||
|
|
||||||
expect(mockedCore.warning).toHaveBeenCalledWith(
|
|
||||||
expect.stringContaining('Failed to copy file')
|
|
||||||
);
|
|
||||||
expect(mockRestoreCache).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('skips path logic if no input is provided', async () => {
|
|
||||||
mockedCore.getInput.mockReturnValue('');
|
|
||||||
|
|
||||||
await cacheDependencies('pip', '3.12');
|
|
||||||
|
|
||||||
expect(mockedFsPromises.copyFile).not.toHaveBeenCalled();
|
|
||||||
expect(mockedCore.warning).not.toHaveBeenCalled();
|
|
||||||
expect(mockRestoreCache).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('does not copy if dependency file is already inside the workspace but still sets resolved path', async () => {
|
|
||||||
// Simulate cacheDependencyPath inside workspace
|
|
||||||
mockedCore.getInput.mockReturnValue('deps.lock');
|
|
||||||
|
|
||||||
// Override sourcePath and targetPath to be equal
|
|
||||||
const actionPath = '/github/workspace'; // same path for action and workspace
|
|
||||||
process.env.GITHUB_ACTION_PATH = actionPath;
|
|
||||||
process.env.GITHUB_WORKSPACE = actionPath;
|
|
||||||
|
|
||||||
// access resolves to simulate file exists
|
|
||||||
mockedFsPromises.access.mockResolvedValue();
|
|
||||||
|
|
||||||
await cacheDependencies('pip', '3.12');
|
|
||||||
|
|
||||||
const sourcePath = path.resolve(actionPath, 'deps.lock');
|
|
||||||
const targetPath = sourcePath; // same path
|
|
||||||
|
|
||||||
expect(mockedFsPromises.copyFile).not.toHaveBeenCalled();
|
|
||||||
expect(mockedCore.info).toHaveBeenCalledWith(
|
|
||||||
`Dependency file is already inside the workspace: ${sourcePath}`
|
|
||||||
);
|
|
||||||
expect(mockedCore.info).toHaveBeenCalledWith(
|
|
||||||
`Resolved cache-dependency-path: deps.lock`
|
|
||||||
);
|
|
||||||
expect(mockRestoreCache).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -39,7 +39,7 @@ outputs:
|
|||||||
python-path:
|
python-path:
|
||||||
description: "The absolute path to the Python or PyPy executable."
|
description: "The absolute path to the Python or PyPy executable."
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/setup/index.js'
|
main: 'dist/setup/index.js'
|
||||||
post: 'dist/cache-save/index.js'
|
post: 'dist/cache-save/index.js'
|
||||||
post-if: success()
|
post-if: success()
|
||||||
|
|||||||
3
dist/cache-save/index.js
vendored
3
dist/cache-save/index.js
vendored
@@ -87883,7 +87883,8 @@ function saveCache(packageManager) {
|
|||||||
const cachePaths = JSON.parse(cachePathState);
|
const cachePaths = JSON.parse(cachePathState);
|
||||||
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
||||||
if (!isCacheDirectoryExists(cachePaths)) {
|
if (!isCacheDirectoryExists(cachePaths)) {
|
||||||
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`);
|
core.warning(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
|
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
|
||||||
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);
|
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);
|
||||||
|
|||||||
43
dist/setup/index.js
vendored
43
dist/setup/index.js
vendored
@@ -97935,7 +97935,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.cacheDependencies = void 0;
|
|
||||||
const core = __importStar(__nccwpck_require__(7484));
|
const core = __importStar(__nccwpck_require__(7484));
|
||||||
const finder = __importStar(__nccwpck_require__(6843));
|
const finder = __importStar(__nccwpck_require__(6843));
|
||||||
const finderPyPy = __importStar(__nccwpck_require__(2625));
|
const finderPyPy = __importStar(__nccwpck_require__(2625));
|
||||||
@@ -97954,50 +97953,10 @@ function isGraalPyVersion(versionSpec) {
|
|||||||
function cacheDependencies(cache, pythonVersion) {
|
function cacheDependencies(cache, pythonVersion) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
|
const cacheDependencyPath = core.getInput('cache-dependency-path') || undefined;
|
||||||
let resolvedDependencyPath = undefined;
|
const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, cacheDependencyPath);
|
||||||
if (cacheDependencyPath) {
|
|
||||||
const actionPath = process.env.GITHUB_ACTION_PATH || '';
|
|
||||||
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
|
|
||||||
const sourcePath = path.resolve(actionPath, cacheDependencyPath);
|
|
||||||
const relativePath = path.relative(actionPath, sourcePath);
|
|
||||||
const targetPath = path.resolve(workspace, relativePath);
|
|
||||||
try {
|
|
||||||
const sourceExists = yield fs_1.default.promises
|
|
||||||
.access(sourcePath, fs_1.default.constants.F_OK)
|
|
||||||
.then(() => true)
|
|
||||||
.catch(() => false);
|
|
||||||
if (!sourceExists) {
|
|
||||||
core.warning(`The resolved cache-dependency-path does not exist: ${sourcePath}`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (sourcePath !== targetPath) {
|
|
||||||
const targetDir = path.dirname(targetPath);
|
|
||||||
// Create target directory if it doesn't exist
|
|
||||||
yield fs_1.default.promises.mkdir(targetDir, { recursive: true });
|
|
||||||
// Copy file asynchronously
|
|
||||||
yield fs_1.default.promises.copyFile(sourcePath, targetPath);
|
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
core.info(`Dependency file is already inside the workspace: ${sourcePath}`);
|
|
||||||
}
|
|
||||||
resolvedDependencyPath = path
|
|
||||||
.relative(workspace, targetPath)
|
|
||||||
.replace(/\\/g, '/');
|
|
||||||
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
core.warning(`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Pass resolvedDependencyPath if available, else fallback to original input
|
|
||||||
const dependencyPathForCache = resolvedDependencyPath !== null && resolvedDependencyPath !== void 0 ? resolvedDependencyPath : cacheDependencyPath;
|
|
||||||
const cacheDistributor = (0, cache_factory_1.getCacheDistributor)(cache, pythonVersion, dependencyPathForCache);
|
|
||||||
yield cacheDistributor.restoreCache();
|
yield cacheDistributor.restoreCache();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.cacheDependencies = cacheDependencies;
|
|
||||||
function resolveVersionInputFromDefaultFile() {
|
function resolveVersionInputFromDefaultFile() {
|
||||||
const couples = [
|
const couples = [
|
||||||
['.python-version', utils_1.getVersionsInputFromPlainFile]
|
['.python-version', utils_1.getVersionsInputFromPlainFile]
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ If there is a specific version of Python that you need and you don't want to wor
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.12.6'
|
python-version: '3.12.6'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -46,8 +46,8 @@ You can specify **only a major and minor version** if you are okay with the most
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -60,8 +60,8 @@ You can specify the version with **prerelease tag** to download and set up an ac
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.14.0-alpha.1'
|
python-version: '3.14.0-alpha.1'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -71,8 +71,8 @@ It's also possible to use **x.y-dev syntax** to download and set up the latest p
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.14-dev'
|
python-version: '3.14-dev'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -84,8 +84,8 @@ Free threaded Python is only available starting with the 3.13 release.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13t'
|
python-version: '3.13t'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -95,8 +95,8 @@ Note that the **t** suffix is not `semver` syntax. If you wish to specify a rang
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '>=3.13'
|
python-version: '>=3.13'
|
||||||
freethreaded: true
|
freethreaded: true
|
||||||
@@ -109,8 +109,8 @@ You can also use several types of ranges that are specified in [semver](https://
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '>=3.9 <3.14'
|
python-version: '>=3.9 <3.14'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -120,8 +120,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13.0-alpha - 3.13.0'
|
python-version: '3.13.0-alpha - 3.13.0'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -131,8 +131,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -164,8 +164,8 @@ jobs:
|
|||||||
- 'pypy3.10' # the latest available version of PyPy that supports Python 3.10
|
- 'pypy3.10' # the latest available version of PyPy that supports Python 3.10
|
||||||
- 'pypy3.10-v7.3.17' # Python 3.10 and PyPy 7.3.17
|
- 'pypy3.10-v7.3.17' # Python 3.10 and PyPy 7.3.17
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -182,8 +182,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: |
|
python-version: |
|
||||||
3.11
|
3.11
|
||||||
@@ -199,8 +199,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: |
|
python-version: |
|
||||||
pypy-3.10-v7.3.x
|
pypy-3.10-v7.3.x
|
||||||
@@ -216,8 +216,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: |
|
python-version: |
|
||||||
3.11
|
3.11
|
||||||
@@ -241,9 +241,9 @@ jobs:
|
|||||||
python-version: ['3.x', 'pypy3.8', 'pypy3.9' ]
|
python-version: ['3.x', 'pypy3.8', 'pypy3.9' ]
|
||||||
name: Python ${{ matrix.python-version }} sample
|
name: Python ${{ matrix.python-version }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
architecture: x64
|
architecture: x64
|
||||||
@@ -267,9 +267,9 @@ jobs:
|
|||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Display Python version
|
- name: Display Python version
|
||||||
@@ -285,8 +285,8 @@ jobs:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version-file: '.python-version' # Read python version from a file .python-version
|
python-version-file: '.python-version' # Read python version from a file .python-version
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -294,8 +294,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version-file: 'pyproject.toml' # Read python version from a file pyproject.toml
|
python-version-file: 'pyproject.toml' # Read python version from a file pyproject.toml
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -303,8 +303,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version-file: '.tool-versions' # Read python version from a file .tool-versions
|
python-version-file: '.tool-versions' # Read python version from a file .tool-versions
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -312,8 +312,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version-file: 'Pipfile' # Read python version from a file Pipfile
|
python-version-file: 'Pipfile' # Read python version from a file Pipfile
|
||||||
- run: python my_script.py
|
- run: python my_script.py
|
||||||
@@ -327,8 +327,8 @@ If `check-latest` is set to `true`, the action first checks if the cached versio
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
@@ -342,8 +342,8 @@ steps:
|
|||||||
**Caching pipenv dependencies:**
|
**Caching pipenv dependencies:**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pipenv'
|
cache: 'pipenv'
|
||||||
@@ -355,10 +355,10 @@ steps:
|
|||||||
**Caching poetry dependencies:**
|
**Caching poetry dependencies:**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Install poetry
|
- name: Install poetry
|
||||||
run: pipx install poetry
|
run: pipx install poetry
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'poetry'
|
cache: 'poetry'
|
||||||
@@ -370,8 +370,8 @@ steps:
|
|||||||
**Using a list of file paths to cache dependencies**
|
**Using a list of file paths to cache dependencies**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pipenv'
|
cache: 'pipenv'
|
||||||
@@ -385,8 +385,8 @@ steps:
|
|||||||
**Using wildcard patterns to cache dependencies**
|
**Using wildcard patterns to cache dependencies**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
@@ -397,8 +397,8 @@ steps:
|
|||||||
**Using a list of wildcard patterns to cache dependencies**
|
**Using a list of wildcard patterns to cache dependencies**
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
@@ -412,8 +412,8 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
@@ -421,7 +421,7 @@ steps:
|
|||||||
- run: pip install -e .
|
- run: pip install -e .
|
||||||
# Or pip install -e '.[test]' to install test dependencies
|
# Or pip install -e '.[test]' to install test dependencies
|
||||||
```
|
```
|
||||||
Note: cache-dependency-path supports files located outside the workspace root by copying them into the workspace to enable proper caching.
|
|
||||||
# Outputs and environment variables
|
# Outputs and environment variables
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
@@ -435,8 +435,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
id: cp312
|
id: cp312
|
||||||
with:
|
with:
|
||||||
python-version: "3.9.0 - 3.12.0"
|
python-version: "3.9.0 - 3.12.0"
|
||||||
@@ -452,8 +452,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
id: cp313
|
id: cp313
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
@@ -468,8 +468,8 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
id: cp313
|
id: cp313
|
||||||
with:
|
with:
|
||||||
python-version: "3.13.0"
|
python-version: "3.13.0"
|
||||||
@@ -477,16 +477,16 @@ jobs:
|
|||||||
- run: echo '${{ steps.cp313.outputs.cache-hit }}' # true if cache-hit occurred on the primary key
|
- run: echo '${{ steps.cp313.outputs.cache-hit }}' # true if cache-hit occurred on the primary key
|
||||||
```
|
```
|
||||||
|
|
||||||
## Environment variables
|
### Environment variables
|
||||||
|
|
||||||
These environment variables become available after setup-python action execution:
|
These environment variables become available after setup-python action execution:
|
||||||
|
|
||||||
| **Env.variable** | **Description** |
|
| **Env.variable** | **Description**|
|
||||||
| ----------- | ----------- |
|
|----------------------|-------------|
|
||||||
| pythonLocation |Contains the absolute path to the folder where the requested version of Python or PyPy is installed|
|
| `pythonLocation` | Contains the absolute path to the folder where the requested version of Python, PyPy, or GraalPy is installed. <br><br>**Executable location by implementation:** <br>• **CPython** – `$pythonLocation/bin/python` (Linux/macOS), `$pythonLocation/python.exe` (Windows) <br>• **PyPy** – `$pythonLocation/bin/python` (Linux/macOS), `$pythonLocation/python.exe` (Windows) <br>• **GraalPy** – `$pythonLocation/bin/python` (Linux/macOS) <br><br>Note: CPython versions include a symlink or copy of the Python executable at the root, while PyPy and GraalPy retain upstream directory layouts. |
|
||||||
| Python_ROOT_DIR | https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython |
|
| `Python_ROOT_DIR` | https://cmake.org/cmake/help/latest/module/FindPython.html#module:FindPython |
|
||||||
| Python2_ROOT_DIR |https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2|
|
| `Python2_ROOT_DIR` | https://cmake.org/cmake/help/latest/module/FindPython2.html#module:FindPython2 |
|
||||||
| Python3_ROOT_DIR |https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3|
|
| `Python3_ROOT_DIR` | https://cmake.org/cmake/help/latest/module/FindPython3.html#module:FindPython3 |
|
||||||
|
|
||||||
## Using `update-environment` flag
|
## Using `update-environment` flag
|
||||||
|
|
||||||
@@ -499,8 +499,8 @@ Such a requirement on side-effect could be because you don't want your composite
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
id: cp313
|
id: cp313
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
@@ -645,8 +645,8 @@ jobs:
|
|||||||
python_version: ["3.11", "3.12", "3.13"]
|
python_version: ["3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.python_version }}"
|
python-version: "${{ matrix.python_version }}"
|
||||||
allow-prereleases: true
|
allow-prereleases: true
|
||||||
@@ -660,9 +660,9 @@ The version of Pip should be specified in the format `major`, `major.minor`, or
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
pip-version: '25.0.1'
|
pip-version: '25.0.1'
|
||||||
@@ -671,4 +671,4 @@ The version of Pip should be specified in the format `major`, `major.minor`, or
|
|||||||
```
|
```
|
||||||
> The `pip-version` input is supported only with standard Python versions. It is not available when using PyPy or GraalPy.
|
> The `pip-version` input is supported only with standard Python versions. It is not available when using PyPy or GraalPy.
|
||||||
|
|
||||||
> Using a specific or outdated version of pip may result in compatibility or security issues and can cause job failures. For best practices and guidance, refer to the official [pip documentation](https://pip.pypa.io/en/stable/).
|
> Using a specific or outdated version of pip may result in compatibility or security issues and can cause job failures. For best practices and guidance, refer to the official [pip documentation](https://pip.pypa.io/en/stable/).
|
||||||
|
|||||||
25
package-lock.json
generated
25
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-python",
|
"name": "setup-python",
|
||||||
"version": "5.0.0",
|
"version": "6.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-python",
|
"name": "setup-python",
|
||||||
"version": "5.0.0",
|
"version": "6.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.3",
|
"@actions/cache": "^4.0.3",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.12",
|
"@types/jest": "^29.5.12",
|
||||||
"@types/node": "^20.11.25",
|
"@types/node": "^24.1.0",
|
||||||
"@types/semver": "^7.7.0",
|
"@types/semver": "^7.7.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||||
"@typescript-eslint/parser": "^5.54.0",
|
"@typescript-eslint/parser": "^5.54.0",
|
||||||
@@ -35,6 +35,9 @@
|
|||||||
"prettier": "^3.5.3",
|
"prettier": "^3.5.3",
|
||||||
"ts-jest": "^29.3.2",
|
"ts-jest": "^29.3.2",
|
||||||
"typescript": "^5.4.2"
|
"typescript": "^5.4.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
@@ -1593,11 +1596,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.11.25",
|
"version": "24.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||||
"integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==",
|
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~7.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-fetch": {
|
"node_modules/@types/node-fetch": {
|
||||||
@@ -5467,9 +5471,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "5.26.5",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.13",
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-python",
|
"name": "setup-python",
|
||||||
"version": "5.0.0",
|
"version": "6.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Setup python action",
|
"description": "Setup python action",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.0.0"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts",
|
"build": "ncc build -o dist/setup src/setup-python.ts && ncc build -o dist/cache-save src/cache-save.ts",
|
||||||
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
||||||
@@ -37,7 +40,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.12",
|
"@types/jest": "^29.5.12",
|
||||||
"@types/node": "^20.11.25",
|
"@types/node": "^24.1.0",
|
||||||
"@types/semver": "^7.7.0",
|
"@types/semver": "^7.7.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
||||||
"@typescript-eslint/parser": "^5.54.0",
|
"@typescript-eslint/parser": "^5.54.0",
|
||||||
|
|||||||
@@ -38,11 +38,12 @@ async function saveCache(packageManager: string) {
|
|||||||
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
|
||||||
|
|
||||||
if (!isCacheDirectoryExists(cachePaths)) {
|
if (!isCacheDirectoryExists(cachePaths)) {
|
||||||
throw new Error(
|
core.warning(
|
||||||
`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(
|
`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(
|
||||||
', '
|
', '
|
||||||
)}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`
|
)}. This likely indicates that there are no dependencies to cache. Consider removing the cache step if it is not needed.`
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const primaryKey = core.getState(State.STATE_CACHE_PRIMARY_KEY);
|
const primaryKey = core.getState(State.STATE_CACHE_PRIMARY_KEY);
|
||||||
|
|||||||
@@ -22,62 +22,13 @@ function isGraalPyVersion(versionSpec: string) {
|
|||||||
return versionSpec.startsWith('graalpy');
|
return versionSpec.startsWith('graalpy');
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cacheDependencies(cache: string, pythonVersion: string) {
|
async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||||
const cacheDependencyPath =
|
const cacheDependencyPath =
|
||||||
core.getInput('cache-dependency-path') || undefined;
|
core.getInput('cache-dependency-path') || undefined;
|
||||||
let resolvedDependencyPath: string | undefined = undefined;
|
|
||||||
|
|
||||||
if (cacheDependencyPath) {
|
|
||||||
const actionPath = process.env.GITHUB_ACTION_PATH || '';
|
|
||||||
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
|
|
||||||
|
|
||||||
const sourcePath = path.resolve(actionPath, cacheDependencyPath);
|
|
||||||
const relativePath = path.relative(actionPath, sourcePath);
|
|
||||||
const targetPath = path.resolve(workspace, relativePath);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const sourceExists = await fs.promises
|
|
||||||
.access(sourcePath, fs.constants.F_OK)
|
|
||||||
.then(() => true)
|
|
||||||
.catch(() => false);
|
|
||||||
|
|
||||||
if (!sourceExists) {
|
|
||||||
core.warning(
|
|
||||||
`The resolved cache-dependency-path does not exist: ${sourcePath}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (sourcePath !== targetPath) {
|
|
||||||
const targetDir = path.dirname(targetPath);
|
|
||||||
// Create target directory if it doesn't exist
|
|
||||||
await fs.promises.mkdir(targetDir, {recursive: true});
|
|
||||||
// Copy file asynchronously
|
|
||||||
await fs.promises.copyFile(sourcePath, targetPath);
|
|
||||||
core.info(`Copied ${sourcePath} to ${targetPath}`);
|
|
||||||
} else {
|
|
||||||
core.info(
|
|
||||||
`Dependency file is already inside the workspace: ${sourcePath}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
resolvedDependencyPath = path
|
|
||||||
.relative(workspace, targetPath)
|
|
||||||
.replace(/\\/g, '/');
|
|
||||||
core.info(`Resolved cache-dependency-path: ${resolvedDependencyPath}`);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
core.warning(
|
|
||||||
`Failed to copy file from ${sourcePath} to ${targetPath}: ${error}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pass resolvedDependencyPath if available, else fallback to original input
|
|
||||||
const dependencyPathForCache = resolvedDependencyPath ?? cacheDependencyPath;
|
|
||||||
|
|
||||||
const cacheDistributor = getCacheDistributor(
|
const cacheDistributor = getCacheDistributor(
|
||||||
cache,
|
cache,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
dependencyPathForCache
|
cacheDependencyPath
|
||||||
);
|
);
|
||||||
await cacheDistributor.restoreCache();
|
await cacheDistributor.restoreCache();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user