mirror of
https://github.com/actions/setup-python.git
synced 2025-06-28 05:33:47 +00:00
test job to validate --user flag installtion
This commit is contained in:
parent
c25a6bd95d
commit
a49e508555
2 changed files with 11 additions and 16 deletions
6
.github/workflows/e2e-tests.yml
vendored
6
.github/workflows/e2e-tests.yml
vendored
|
@ -139,6 +139,6 @@ jobs:
|
||||||
|
|
||||||
- name: Verify Install Path
|
- name: Verify Install Path
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: python __tests__/verify-windows-install-path.py `
|
run: python __tests__/verify-windows-install-path.py ``
|
||||||
-arch ${{ matrix.architecture }} `
|
-arch ${{ matrix.architecture }} `
|
||||||
-freethreaded ${{ matrix.freethreaded }}
|
-freethreaded ${{ matrix.freethreaded }} `
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def build_expected_path(architecture, freethreaded, major, minor):
|
def build_expected_path(architecture, freethreaded):
|
||||||
|
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)):
|
||||||
|
@ -20,20 +22,14 @@ def build_expected_path(architecture, freethreaded, major, minor):
|
||||||
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():
|
||||||
# Expecting: -arch <architecture> -freethreaded <freethreaded>
|
if len(sys.argv) != 3:
|
||||||
if len(sys.argv) != 5:
|
print("Usage: python verify_windows_install_path.py <architecture> <freethreaded>")
|
||||||
print("Usage: python verify-windows-install-path.py -arch <architecture> -freethreaded <freethreaded>")
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
args = dict(zip(sys.argv[1::2], sys.argv[2::2]))
|
architecture = sys.argv[1]
|
||||||
architecture = args.get('-arch')
|
freethreaded = sys.argv[2]
|
||||||
freethreaded = args.get('-freethreaded')
|
|
||||||
|
|
||||||
# Get major and minor version from current Python
|
expected_path = build_expected_path(architecture, freethreaded)
|
||||||
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", "")
|
||||||
|
@ -42,7 +38,6 @@ 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