Add Windows

This commit is contained in:
Charlie Marsh 2025-07-20 18:17:51 -04:00
parent 2312a604f6
commit ee331bfdf5
1 changed files with 39 additions and 1 deletions

View File

@ -373,6 +373,24 @@ pub(crate) fn create(
&scripts, &scripts,
python_home, python_home,
)?; )?;
// If the GIL is disabled, copy `venvlaunchert.exe` and `venvwlaunchert.exe`.
if interpreter.gil_disabled() {
copy_launcher_windows(
WindowsExecutable::PythonMajorMinort,
interpreter,
&base_python,
&scripts,
python_home,
)?;
copy_launcher_windows(
WindowsExecutable::PythonwMajorMinort,
interpreter,
&base_python,
&scripts,
python_home,
)?;
}
} }
} }
} }
@ -590,8 +608,12 @@ enum WindowsExecutable {
PythonMajor, PythonMajor,
/// The `python3.<minor>.exe` executable (or `venvlauncher.exe` launcher shim). /// The `python3.<minor>.exe` executable (or `venvlauncher.exe` launcher shim).
PythonMajorMinor, PythonMajorMinor,
/// The `python3.<minor>t.exe` executable (or `venvlaunchert.exe` launcher shim).
PythonMajorMinort,
/// The `pythonw.exe` executable (or `venvwlauncher.exe` launcher shim). /// The `pythonw.exe` executable (or `venvwlauncher.exe` launcher shim).
Pythonw, Pythonw,
/// The `pythonw3.<minor>t.exe` executable (or `venvwlaunchert.exe` launcher shim).
PythonwMajorMinort,
/// The `pypy.exe` executable. /// The `pypy.exe` executable.
PyPy, PyPy,
/// The `pypy3.exe` executable. /// The `pypy3.exe` executable.
@ -602,7 +624,7 @@ enum WindowsExecutable {
PyPyw, PyPyw,
/// The `pypy3.<minor>w.exe` executable. /// The `pypy3.<minor>w.exe` executable.
PyPyMajorMinorw, PyPyMajorMinorw,
// The `graalpy.exe` executable /// The `graalpy.exe` executable.
GraalPy, GraalPy,
} }
@ -621,7 +643,21 @@ impl WindowsExecutable {
interpreter.python_minor() interpreter.python_minor()
) )
} }
WindowsExecutable::PythonMajorMinort => {
format!(
"python{}.{}t.exe",
interpreter.python_major(),
interpreter.python_minor()
)
}
WindowsExecutable::Pythonw => String::from("pythonw.exe"), WindowsExecutable::Pythonw => String::from("pythonw.exe"),
WindowsExecutable::PythonwMajorMinort => {
format!(
"pythonw{}.{}t.exe",
interpreter.python_major(),
interpreter.python_minor()
)
}
WindowsExecutable::PyPy => String::from("pypy.exe"), WindowsExecutable::PyPy => String::from("pypy.exe"),
WindowsExecutable::PyPyMajor => { WindowsExecutable::PyPyMajor => {
format!("pypy{}.exe", interpreter.python_major()) format!("pypy{}.exe", interpreter.python_major())
@ -656,6 +692,8 @@ impl WindowsExecutable {
Self::Python | Self::PythonMajor | Self::PythonMajorMinor => "venvlauncher.exe", Self::Python | Self::PythonMajor | Self::PythonMajorMinor => "venvlauncher.exe",
Self::Pythonw if interpreter.gil_disabled() => "venvwlaunchert.exe", Self::Pythonw if interpreter.gil_disabled() => "venvwlaunchert.exe",
Self::Pythonw => "venvwlauncher.exe", Self::Pythonw => "venvwlauncher.exe",
Self::PythonMajorMinort => "venvlaunchert.exe",
Self::PythonwMajorMinort => "venvwlaunchert.exe",
// From 3.13 on these should replace the `python.exe` and `pythonw.exe` shims. // From 3.13 on these should replace the `python.exe` and `pythonw.exe` shims.
// These are not relevant as of now for PyPy as it doesn't yet support Python 3.13. // These are not relevant as of now for PyPy as it doesn't yet support Python 3.13.
Self::PyPy | Self::PyPyMajor | Self::PyPyMajorMinor => "venvlauncher.exe", Self::PyPy | Self::PyPyMajor | Self::PyPyMajorMinor => "venvlauncher.exe",