Skip to content

Commit 71f96cd

Browse files
authored
Fix PyPy3 Windows stlib path (#2072)
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 742e145 commit 71f96cd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/changelog/2071.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix PyPy3 stdlib on Windows is incorrect - by :user:`gaborbernat`.

src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@ class PyPy3(PyPy, Python3Supports):
1717
def exe_stem(cls):
1818
return "pypy3"
1919

20-
@property
21-
def stdlib(self):
22-
"""
23-
PyPy3 seems to respect sysconfig only for the host python...
24-
virtual environments purelib is instead lib/pythonx.y
25-
"""
26-
return self.dest / "lib" / "python{}".format(self.interpreter.version_release_str) / "site-packages"
27-
2820
@classmethod
2921
def exe_names(cls, interpreter):
3022
return super(PyPy3, cls).exe_names(interpreter) | {"pypy"}
@@ -33,6 +25,11 @@ def exe_names(cls, interpreter):
3325
class PyPy3Posix(PyPy3, PosixSupports):
3426
"""PyPy 2 on POSIX"""
3527

28+
@property
29+
def stdlib(self):
30+
"""PyPy3 respects sysconfig only for the host python, virtual envs is instead lib/pythonx.y/site-packages"""
31+
return self.dest / "lib" / "python{}".format(self.interpreter.version_release_str) / "site-packages"
32+
3633
@classmethod
3734
def _shared_libs(cls):
3835
return ["libpypy3-c.so", "libpypy3-c.dylib"]
@@ -53,6 +50,11 @@ def sources(cls, interpreter):
5350
class Pypy3Windows(PyPy3, WindowsSupports):
5451
"""PyPy 2 on Windows"""
5552

53+
@property
54+
def stdlib(self):
55+
"""PyPy3 respects sysconfig only for the host python, virtual envs is instead Lib/site-packages"""
56+
return self.dest / "Lib" / "site-packages"
57+
5658
@property
5759
def bin_dir(self):
5860
"""PyPy3 needs to fallback to pypy definition"""

0 commit comments

Comments
 (0)