mirror of
https://github.com/actions/setup-python.git
synced 2026-06-24 17:11:27 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ece7cb06ca | |||
| 1d18d7af5f |
@@ -33,7 +33,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0, 3.13.1, 3.13.2]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install poetry
|
||||
run: pipx install poetry
|
||||
- name: Init pyproject.toml
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -160,7 +160,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.1t, 3.13.2t, 3.13.5t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
@@ -201,7 +201,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -229,7 +229,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -284,7 +284,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
python-version: pypy-3.9-v7.x
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
- os: ubuntu-22.04-arm
|
||||
python-version: pypy-3.10-v7.x
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
@@ -143,7 +143,7 @@ jobs:
|
||||
'3.13'
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install poetry
|
||||
run: |
|
||||
pipx install poetry
|
||||
@@ -194,7 +194,7 @@ jobs:
|
||||
- os: macos-latest
|
||||
python-version: pypy-3.9-v7.x
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
- os: ubuntu-22.04-arm
|
||||
python-version: pypy-3.11-v7.x
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
id: cache-pipenv
|
||||
uses: ./
|
||||
@@ -278,7 +278,7 @@ jobs:
|
||||
]
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -306,7 +306,7 @@ jobs:
|
||||
]
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -335,7 +335,7 @@ jobs:
|
||||
]
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
@@ -361,7 +361,7 @@ jobs:
|
||||
]
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run with setup-python 3.9.13
|
||||
uses: ./
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checking out
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
- name: Publish
|
||||
id: publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.graalpy }}
|
||||
id: setup-python
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.graalpy }}
|
||||
id: setup-python
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup GraalPy and check latest
|
||||
uses: ./
|
||||
id: graalpy
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.pypy }}
|
||||
id: setup-python
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.pypy }}
|
||||
id: setup-python
|
||||
@@ -150,7 +150,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.pypy }}
|
||||
id: setup-python
|
||||
@@ -181,7 +181,7 @@ jobs:
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup PyPy and check latest
|
||||
uses: ./
|
||||
with:
|
||||
@@ -223,7 +223,7 @@ jobs:
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup PyPy and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: echo ${{ matrix.python }} > .python-version
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: echo ${{ matrix.python }} > .python-version
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
python: [3.13.0, 3.13.1, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -189,7 +189,7 @@ jobs:
|
||||
python: [3.13.0, 3.13.1, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-tool-versions-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -261,7 +261,7 @@ jobs:
|
||||
python: [3.13t, 3.14t-dev]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -301,7 +301,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t, 3.14t-dev]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -340,7 +340,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14.0-alpha.6
|
||||
id: setup-python
|
||||
@@ -377,7 +377,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14t-dev
|
||||
id: setup-python
|
||||
@@ -414,7 +414,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14t
|
||||
id: setup-python
|
||||
@@ -453,7 +453,7 @@ jobs:
|
||||
python: [3.13.0t, 3.13.1t, 3.13.2t]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
@@ -485,7 +485,7 @@ jobs:
|
||||
]
|
||||
python-version: [3.13t, 3.14t-dev]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python and check latest
|
||||
id: setup-python
|
||||
uses: ./
|
||||
@@ -511,7 +511,7 @@ jobs:
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python and check latest
|
||||
id: setup-python
|
||||
uses: ./
|
||||
@@ -542,7 +542,7 @@ jobs:
|
||||
python: [3.13.1, 3.13.2, 3.14-dev, 3.14.0-alpha.6]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
uses: ./
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.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]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
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]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
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]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
python: [3.9.13, 3.10.11, 3.11.9, 3.12.3, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -272,7 +272,7 @@ jobs:
|
||||
python: graalpy-24.1.2
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-tool-versions-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -303,7 +303,7 @@ jobs:
|
||||
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -353,7 +353,7 @@ jobs:
|
||||
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: build-version-file ${{ matrix.python }}
|
||||
run: |
|
||||
@@ -402,7 +402,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14.0-alpha.6
|
||||
id: setup-python
|
||||
@@ -445,7 +445,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14-dev
|
||||
id: setup-python
|
||||
@@ -482,7 +482,7 @@ jobs:
|
||||
]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python 3.14
|
||||
id: setup-python
|
||||
@@ -521,7 +521,7 @@ jobs:
|
||||
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: setup-python ${{ matrix.python }}
|
||||
id: setup-python
|
||||
@@ -553,7 +553,7 @@ jobs:
|
||||
]
|
||||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python and check latest
|
||||
uses: ./
|
||||
with:
|
||||
@@ -585,7 +585,7 @@ jobs:
|
||||
macos-15-intel
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup Python and check latest
|
||||
uses: ./
|
||||
with:
|
||||
|
||||
Vendored
+14
-9
@@ -54331,24 +54331,29 @@ class PipCache extends cache_distributor_1.default {
|
||||
this.pythonVersion = pythonVersion;
|
||||
}
|
||||
async getCacheGlobalDirectories() {
|
||||
let exitCode = 1;
|
||||
let exitCode = 0;
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
// Add temporary fix for Windows
|
||||
// On windows it is necessary to execute through an exec
|
||||
// because the getExecOutput gives a non zero code or writes to stderr for pip 22.0.2,
|
||||
// On Windows, it is necessary to execute through an exec
|
||||
// because the getExecOutput gives a non-zero code or writes to stderr for pip 22.0.2,
|
||||
// or spawn must be started with the shell option enabled for getExecOutput
|
||||
// Related issue: https://github.com/actions/setup-python/issues/328
|
||||
if (utils_1.IS_WINDOWS) {
|
||||
const execPromisify = util_1.default.promisify(child_process.exec);
|
||||
({ stdout: stdout, stderr: stderr } = await execPromisify('pip cache dir'));
|
||||
try {
|
||||
({ stdout, stderr } = await execPromisify('pip cache dir'));
|
||||
}
|
||||
catch (err) {
|
||||
// Pip outputs warnings to stderr (e.g., --no-python-version-warning flag deprecation warning), causing false failure detection
|
||||
// Related issue: https://github.com/actions/setup-python/issues/1034
|
||||
// If an error occurs, capture stderr and set exitCode to 1 to indicate failure
|
||||
stderr = err.stderr ?? err.message;
|
||||
exitCode = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
({
|
||||
stdout: stdout,
|
||||
stderr: stderr,
|
||||
exitCode: exitCode
|
||||
} = await exec.getExecOutput('pip cache dir'));
|
||||
({ stdout, stderr, exitCode } = await exec.getExecOutput('pip cache dir'));
|
||||
}
|
||||
if (exitCode && stderr) {
|
||||
throw new Error(`Could not get cache folder path for pip package manager`);
|
||||
|
||||
@@ -555,8 +555,8 @@ GitHub hosted runners have a tool cache that comes with a few versions of Python
|
||||
|**PyPy tool cache**|`RUNNER_TOOL_CACHE/PyPy/*`|
|
||||
|
||||
GitHub runner images are set up in [actions/runner-images](https://github.com/actions/runner-images). During the setup, the available versions of Python and PyPy are automatically downloaded, set up and documented.
|
||||
- Tool cache setup for Ubuntu: [Install-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/linux/scripts/installers/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/linux/scripts/installers/Configure-Toolset.ps1)
|
||||
- Tool cache setup for Windows: [Install-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/win/scripts/Installers/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/win/scripts/Installers/Configure-Toolset.ps1)
|
||||
- Tool cache setup for Ubuntu: [Install-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/Configure-Toolset.ps1)
|
||||
- Tool cache setup for Windows: [Install-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Install-Toolset.ps1) [Configure-Toolset.ps1](https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Configure-Toolset.ps1)
|
||||
|
||||
|
||||
## Using `setup-python` with a self-hosted runner
|
||||
|
||||
@@ -21,24 +21,28 @@ class PipCache extends CacheDistributor {
|
||||
}
|
||||
|
||||
protected async getCacheGlobalDirectories() {
|
||||
let exitCode = 1;
|
||||
let exitCode = 0;
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
|
||||
// Add temporary fix for Windows
|
||||
// On windows it is necessary to execute through an exec
|
||||
// because the getExecOutput gives a non zero code or writes to stderr for pip 22.0.2,
|
||||
// On Windows, it is necessary to execute through an exec
|
||||
// because the getExecOutput gives a non-zero code or writes to stderr for pip 22.0.2,
|
||||
// or spawn must be started with the shell option enabled for getExecOutput
|
||||
// Related issue: https://github.com/actions/setup-python/issues/328
|
||||
if (IS_WINDOWS) {
|
||||
const execPromisify = utils.promisify(child_process.exec);
|
||||
({stdout: stdout, stderr: stderr} = await execPromisify('pip cache dir'));
|
||||
try {
|
||||
({stdout, stderr} = await execPromisify('pip cache dir'));
|
||||
} catch (err) {
|
||||
// Pip outputs warnings to stderr (e.g., --no-python-version-warning flag deprecation warning), causing false failure detection
|
||||
// Related issue: https://github.com/actions/setup-python/issues/1034
|
||||
// If an error occurs, capture stderr and set exitCode to 1 to indicate failure
|
||||
stderr = (err as any).stderr ?? (err as Error).message;
|
||||
exitCode = 1;
|
||||
}
|
||||
} else {
|
||||
({
|
||||
stdout: stdout,
|
||||
stderr: stderr,
|
||||
exitCode: exitCode
|
||||
} = await exec.getExecOutput('pip cache dir'));
|
||||
({stdout, stderr, exitCode} = await exec.getExecOutput('pip cache dir'));
|
||||
}
|
||||
|
||||
if (exitCode && stderr) {
|
||||
|
||||
Reference in New Issue
Block a user