Skip to content

Fix Windows compatibility in test_package.py script#3804

Open
colloceo wants to merge 2 commits intoethereum:mainfrom
colloceo:main
Open

Fix Windows compatibility in test_package.py script#3804
colloceo wants to merge 2 commits intoethereum:mainfrom
colloceo:main

Conversation

@colloceo
Copy link

What was wrong?

The test_package.py script had hardcoded Unix-style paths (bin/pip) that would fail on Windows systems. Additionally, the activation command message only showed Unix instructions, making it confusing for Windows users. The code also had duplication of the pip path logic between create_venv() and install_wheel() functions, and used a generic Exception type instead of a more specific exception.

Related to Issue # (leave blank if none)

Closes # (leave blank if none)

How was it fixed?

  • Introduced a get_pip_exe() helper function to centralize platform-specific pip executable path detection (Windows: Scripts/pip.exe, Unix: bin/pip)
  • Updated both create_venv() and install_wheel() to use the new helper function, eliminating code duplication
  • Added platform-specific activation command instructions (Windows: Scripts\activate, Unix: source bin/activate)
  • Changed generic Exception to ValueError for better error handling when multiple or no wheels are found

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes (N/A - internal test script)
  • Add entry to the release notes (N/A - internal test script change)

Cute Animal Picture

Cute Python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant