From 71f96cdb71093ec64f3eecd9e4ea51793fd9b165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 16 Mar 2021 08:06:10 +0000 Subject: [PATCH] Fix PyPy3 Windows stlib path (#2072) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- docs/changelog/2071.bugfix.rst | 1 + .../via_global_ref/builtin/pypy/pypy3.py | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 docs/changelog/2071.bugfix.rst diff --git a/docs/changelog/2071.bugfix.rst b/docs/changelog/2071.bugfix.rst new file mode 100644 index 000000000..c8c87b35f --- /dev/null +++ b/docs/changelog/2071.bugfix.rst @@ -0,0 +1 @@ +Fix PyPy3 stdlib on Windows is incorrect - by :user:`gaborbernat`. diff --git a/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py b/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py index 958870678..65b2e099c 100644 --- a/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py +++ b/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py @@ -17,14 +17,6 @@ class PyPy3(PyPy, Python3Supports): def exe_stem(cls): return "pypy3" - @property - def stdlib(self): - """ - PyPy3 seems to respect sysconfig only for the host python... - virtual environments purelib is instead lib/pythonx.y - """ - return self.dest / "lib" / "python{}".format(self.interpreter.version_release_str) / "site-packages" - @classmethod def exe_names(cls, interpreter): return super(PyPy3, cls).exe_names(interpreter) | {"pypy"} @@ -33,6 +25,11 @@ def exe_names(cls, interpreter): class PyPy3Posix(PyPy3, PosixSupports): """PyPy 2 on POSIX""" + @property + def stdlib(self): + """PyPy3 respects sysconfig only for the host python, virtual envs is instead lib/pythonx.y/site-packages""" + return self.dest / "lib" / "python{}".format(self.interpreter.version_release_str) / "site-packages" + @classmethod def _shared_libs(cls): return ["libpypy3-c.so", "libpypy3-c.dylib"] @@ -53,6 +50,11 @@ def sources(cls, interpreter): class Pypy3Windows(PyPy3, WindowsSupports): """PyPy 2 on Windows""" + @property + def stdlib(self): + """PyPy3 respects sysconfig only for the host python, virtual envs is instead Lib/site-packages""" + return self.dest / "Lib" / "site-packages" + @property def bin_dir(self): """PyPy3 needs to fallback to pypy definition"""