Skip to content

Commit 672169f

Browse files
committed
Add pypy exes in Windows when creating new env
1 parent f8c76ed commit 672169f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

crates/uv-virtualenv/src/bare.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,23 @@ pub fn create_bare_venv(
196196
&scripts,
197197
python_home,
198198
)?;
199+
200+
if interpreter.markers().implementation_name() == "pypy" {
201+
copy_launcher_windows(
202+
WindowsExecutable::PyPy,
203+
interpreter,
204+
&base_python,
205+
&scripts,
206+
python_home,
207+
)?;
208+
copy_launcher_windows(
209+
WindowsExecutable::PyPyw,
210+
interpreter,
211+
&base_python,
212+
&scripts,
213+
python_home,
214+
)?;
215+
}
199216
}
200217

201218
#[cfg(not(any(unix, windows)))]
@@ -314,6 +331,10 @@ enum WindowsExecutable {
314331
Python,
315332
/// The `pythonw.exe` executable (or `venvwlauncher.exe` launcher shim).
316333
Pythonw,
334+
// The `pypy.exe` executable
335+
PyPy,
336+
// The `pypyw.exe` executable
337+
PyPyw,
317338
}
318339

319340
impl WindowsExecutable {
@@ -322,6 +343,8 @@ impl WindowsExecutable {
322343
match self {
323344
WindowsExecutable::Python => "python.exe",
324345
WindowsExecutable::Pythonw => "pythonw.exe",
346+
WindowsExecutable::PyPy => "pypy.exe",
347+
WindowsExecutable::PyPyw => "pypyw.exe",
325348
}
326349
}
327350

@@ -330,6 +353,8 @@ impl WindowsExecutable {
330353
match self {
331354
WindowsExecutable::Python => "venvlauncher.exe",
332355
WindowsExecutable::Pythonw => "venvwlauncher.exe",
356+
WindowsExecutable::PyPy => "venvlauncher.exe",
357+
WindowsExecutable::PyPyw => "venvwlauncher.exe",
333358
}
334359
}
335360
}

0 commit comments

Comments
 (0)