Skip to content

Add Architecture-Specific PATH Management for Python with --user Flag on Windows #1122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
  • Loading branch information
aparnajyothi-y committed Jun 10, 2025
commit c25a6bd95d636e80b29451ea3e8efefd9f6ee71f
51 changes: 50 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Verify 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: ./
with:
python-version: 3.10.11
Expand Down Expand Up @@ -89,7 +89,56 @@ jobs:
python-version: '<3.13'
- name: Verify <3.13
run: python __tests__/verify-python.py 3.12

- name: Test Raw Endpoint Access
run: |
curl -L https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json | jq empty
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 }}
21 changes: 13 additions & 8 deletions __tests__/verify_windows_install_path_user.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import os
import sys

def build_expected_path(architecture, freethreaded):
major = 3
minor = 13
def build_expected_path(architecture, freethreaded, major, minor):
version_suffix = f"{major}{minor}"

if architecture == "x86" and (major > 3 or (major == 3 and minor >= 10)):
Expand All @@ -22,14 +20,20 @@ def build_expected_path(architecture, freethreaded):
return os.path.join(base_path, "Python", f"Python{version_suffix}", "Scripts")

def main():
if len(sys.argv) != 3:
print("Usage: python verify_windows_install_path.py <architecture> <freethreaded>")
# Expecting: -arch <architecture> -freethreaded <freethreaded>
if len(sys.argv) != 5:
print("Usage: python verify-windows-install-path.py -arch <architecture> -freethreaded <freethreaded>")
sys.exit(1)

architecture = sys.argv[1]
freethreaded = sys.argv[2]
args = dict(zip(sys.argv[1::2], sys.argv[2::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}")

path_env = os.getenv("PATH", "")
Expand All @@ -38,6 +42,7 @@ def main():
sys.exit(1)
else:
print("Correct path present in PATH")
print(f"Verified path: {expected_path}")

if __name__ == "__main__":
main()
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy