diff --git a/docs/changelog/2182.bugfix.txt b/docs/changelog/2182.bugfix.txt index 0f26a202b..6736aead2 100644 --- a/docs/changelog/2182.bugfix.txt +++ b/docs/changelog/2182.bugfix.txt @@ -1,2 +1,2 @@ -Fixed path collision that could lead to a PermissionError or writing to system -directories when using PyPy3.8 - by :user:`mgorny`. +Removed outdated PyPy-specific copy of prefix/lib contents, which breaks +when using PyPy3.8 - by :user:`mgorny`. 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 f740de963..3524f55ca 100644 --- a/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py +++ b/src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py @@ -5,8 +5,6 @@ from six import add_metaclass from virtualenv.create.describe import PosixSupports, Python3Supports, WindowsSupports -from virtualenv.create.via_global_ref.builtin.ref import PathRefToDest -from virtualenv.util.path import Path from .common import PyPy @@ -28,7 +26,7 @@ class PyPy3Posix(PyPy3, PosixSupports): @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" + return self.dest / "lib" / "pypy{}".format(self.interpreter.version_release_str) / "site-packages" @classmethod def _shared_libs(cls): @@ -37,17 +35,6 @@ def _shared_libs(cls): def to_lib(self, src): return self.dest / "lib" / src.name - @classmethod - def sources(cls, interpreter): - for src in super(PyPy3Posix, cls).sources(interpreter): - yield src - host_lib = Path(interpreter.system_prefix) / "lib" - if host_lib.exists() and host_lib.is_dir(): - for path in host_lib.iterdir(): - if path.is_dir(): - continue - yield PathRefToDest(path, dest=cls.to_lib) - class Pypy3Windows(PyPy3, WindowsSupports): """PyPy 2 on Windows"""