-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Rename python3.13t.exe
to python.exe
in Windows free-threaded distributions
#373
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1759,6 +1759,15 @@ def build_cpython( | |
log("copying %s to %s" % (source, dest)) | ||
shutil.copyfile(source, dest) | ||
|
||
# Rename to `python.exe` when an alternative executable is built, e.g., when | ||
# free-threading is enabled the name is `python3.13t.exe`. | ||
canonical_python_exe = install_dir / "python.exe" | ||
if not canonical_python_exe.exists(): | ||
os.rename( | ||
install_dir / python_exe, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to instead test whether There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I considered both option and don't see a strong case for either one. I think this approach avoids coupling assumptions about the name and mildly prefer it for that reason. |
||
canonical_python_exe, | ||
) | ||
|
||
# CPython 3.13 removed `run_tests.py`, we provide a compatibility script | ||
# for now. | ||
if meets_python_minimum_version(python_version, "3.13"): | ||
|
@@ -1811,13 +1820,12 @@ def build_cpython( | |
} | ||
|
||
# Collect information from running Python script. | ||
python_exe = out_dir / "python" / "install" / python_exe | ||
metadata_path = td / "metadata.json" | ||
env = dict(os.environ) | ||
env["ROOT"] = str(out_dir / "python") | ||
subprocess.run( | ||
[ | ||
str(python_exe), | ||
str(canonical_python_exe), | ||
str(SUPPORT / "generate_metadata.py"), | ||
str(metadata_path), | ||
], | ||
|
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.
Is
install_dir
the same asout_dir / "python" / "install"
?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.
I'm just comparing to
python_exe = out_dir / "python" / "install" / python_exe
below.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.
Yep
https://github.com/indygreg/python-build-standalone/blob/00ea84cd2a525c8d20566482633903878bae2996/cpython-windows/build.py#L1655