-
Notifications
You must be signed in to change notification settings - Fork 290
Don't use thread-free python version 3.13t on Windows #5077
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
Conversation
…thread-free version so we can successfully install all of the windows packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes Python package installation failures on Windows by detecting and avoiding Python 3.13t (free-threaded experimental build). The free-threaded version of Python 3.13 is incompatible with CFFI, which is a dependency of packages like azure.storage.blob and cryptography. When Python 3.13t is detected, the script falls back to using the standard Python 3.13 build.
Key changes:
- Modified the virtual environment creation command on Windows to detect and avoid Python 3.13t
- Added fallback logic to use
py -3.13when the default Python 3 is the incompatible 3.13t version
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -138,7 +138,7 @@ def get_pre_commands( | |||
| # Run inside a python venv | |||
| if os_group == "windows": | |||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback to py -3.13 assumes that a non-free-threaded Python 3.13 is available on the system. While the Windows Python launcher will provide an error if 3.13 is not installed, consider adding a comment to document this assumption and the expected Helix environment configuration.
| if os_group == "windows": | |
| if os_group == "windows": | |
| # Assumes a non-free-threaded Python 3.13 is installed and available via the | |
| # Windows Python launcher as `py -3.13` on Helix Windows queues. The `py -3` | |
| # invocation first checks whether it is a free-threaded 3.13 build and avoids | |
| # using it; if so, we fall back to `py -3.13` which must be present in the | |
| # Helix environment. |
| @@ -138,7 +138,7 @@ def get_pre_commands( | |||
| # Run inside a python venv | |||
| if os_group == "windows": | |||
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This complex one-liner command is difficult to read and maintain. The command combines detection logic, conditional execution, and fallback behavior all in a single line. Consider breaking this into multiple commands with clear comments explaining each step, or at minimum, add an inline comment explaining the logic: "Detect if running 3.13t (free-threaded), and if so, use py -3.13 instead to avoid CFFI compatibility issues".
| if os_group == "windows": | |
| if os_group == "windows": | |
| # Detect if `py -3` is Python 3.13 in experimental free-threaded mode; if so, avoid using it | |
| # to create the venv (due to CFFI compatibility issues) and instead fall back to `py -3.13`. |
If we would use the python version 3.13t, don't, instead use the non-thread-free version so we can successfully install all of the windows packages.
This will fix errors, such as the following, that are occurring because the packages we are trying to install are incompatible with the 3.13t version of python.
Details
Test run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2874993&view=results
Successfully ran microbenchmarks on machine PerfViper098 which had been failing before (only 1 run due to sanity check). Also successfully ran the android tests set to run.