mirror of
https://github.com/actions/setup-python.git
synced 2025-06-27 21:23:48 +00:00
update
This commit is contained in:
parent
4c7c4b45a8
commit
c25a6bd95d
2 changed files with 63 additions and 9 deletions
51
.github/workflows/e2e-tests.yml
vendored
51
.github/workflows/e2e-tests.yml
vendored
|
@ -38,7 +38,7 @@ jobs:
|
||||||
- name: Verify 3.9.13
|
- name: Verify 3.9.13
|
||||||
run: python __tests__/verify-python.py 3.9.13
|
run: python __tests__/verify-python.py 3.9.13
|
||||||
|
|
||||||
- name: Run with setup-python 3.9.13
|
- name: Run with setup-python 3.10.11
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
python-version: 3.10.11
|
python-version: 3.10.11
|
||||||
|
@ -89,7 +89,56 @@ jobs:
|
||||||
python-version: '<3.13'
|
python-version: '<3.13'
|
||||||
- name: Verify <3.13
|
- name: Verify <3.13
|
||||||
run: python __tests__/verify-python.py 3.12
|
run: python __tests__/verify-python.py 3.12
|
||||||
|
|
||||||
- name: Test Raw Endpoint Access
|
- name: Test Raw Endpoint Access
|
||||||
run: |
|
run: |
|
||||||
curl -L https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | jq empty
|
curl -L https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | jq empty
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
verify-install-path:
|
||||||
|
name: Verify Install Path
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [windows-11-arm]
|
||||||
|
architecture: [x86, arm64]
|
||||||
|
python-version: ['3.11', '3.12', '3.13.1', '3.14.0-beta.2']
|
||||||
|
freethreaded: ['false']
|
||||||
|
include:
|
||||||
|
- os: windows-11-arm
|
||||||
|
architecture: x86
|
||||||
|
python-version: '3.13.1'
|
||||||
|
freethreaded: true
|
||||||
|
- os: windows-11-arm
|
||||||
|
architecture: arm64
|
||||||
|
python-version: '3.13.1'
|
||||||
|
freethreaded: true
|
||||||
|
- os: windows-11-arm
|
||||||
|
architecture: x86
|
||||||
|
python-version: '3.14.0-beta.2'
|
||||||
|
freethreaded: true
|
||||||
|
- os: windows-11-arm
|
||||||
|
architecture: arm64
|
||||||
|
python-version: '3.14.0-beta.2'
|
||||||
|
freethreaded: true
|
||||||
|
- os: windows-latest
|
||||||
|
architecture: x86
|
||||||
|
python-version: '3.10'
|
||||||
|
freethreaded: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
architecture: ${{ matrix.architecture }}
|
||||||
|
freethreaded: ${{ matrix.freethreaded }}
|
||||||
|
|
||||||
|
- name: Verify Install Path
|
||||||
|
shell: pwsh
|
||||||
|
run: python __tests__/verify-windows-install-path.py `
|
||||||
|
-arch ${{ matrix.architecture }} `
|
||||||
|
-freethreaded ${{ matrix.freethreaded }}
|
|
@ -1,9 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def build_expected_path(architecture, freethreaded):
|
def build_expected_path(architecture, freethreaded, major, minor):
|
||||||
major = 3
|
|
||||||
minor = 13
|
|
||||||
version_suffix = f"{major}{minor}"
|
version_suffix = f"{major}{minor}"
|
||||||
|
|
||||||
if architecture == "x86" and (major > 3 or (major == 3 and minor >= 10)):
|
if architecture == "x86" and (major > 3 or (major == 3 and minor >= 10)):
|
||||||
|
@ -22,14 +20,20 @@ def build_expected_path(architecture, freethreaded):
|
||||||
return os.path.join(base_path, "Python", f"Python{version_suffix}", "Scripts")
|
return os.path.join(base_path, "Python", f"Python{version_suffix}", "Scripts")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) != 3:
|
# Expecting: -arch <architecture> -freethreaded <freethreaded>
|
||||||
print("Usage: python verify_windows_install_path.py <architecture> <freethreaded>")
|
if len(sys.argv) != 5:
|
||||||
|
print("Usage: python verify-windows-install-path.py -arch <architecture> -freethreaded <freethreaded>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
architecture = sys.argv[1]
|
args = dict(zip(sys.argv[1::2], sys.argv[2::2]))
|
||||||
freethreaded = sys.argv[2]
|
architecture = args.get('-arch')
|
||||||
|
freethreaded = args.get('-freethreaded')
|
||||||
|
|
||||||
expected_path = build_expected_path(architecture, freethreaded)
|
# Get major and minor version from current Python
|
||||||
|
major = sys.version_info.major
|
||||||
|
minor = sys.version_info.minor
|
||||||
|
|
||||||
|
expected_path = build_expected_path(architecture, freethreaded, major, minor)
|
||||||
print(f"Expected PATH entry: {expected_path}")
|
print(f"Expected PATH entry: {expected_path}")
|
||||||
|
|
||||||
path_env = os.getenv("PATH", "")
|
path_env = os.getenv("PATH", "")
|
||||||
|
@ -38,6 +42,7 @@ def main():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
print("Correct path present in PATH")
|
print("Correct path present in PATH")
|
||||||
|
print(f"Verified path: {expected_path}")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue