Skip to content

Commit

Permalink
Fix Pypy3 Windows stdlib path
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Mar 1, 2021
1 parent 3d03091 commit 5144e6a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==20.8b1]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.7.1
rev: v1.8.0
hooks:
- id: rst-backticks
- repo: https://github.com/tox-dev/tox-ini-fmt
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2071.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix PyPy3 stdlib on Windows is incorrect - by :user:`gaborbernat`.
18 changes: 10 additions & 8 deletions src/virtualenv/create/via_global_ref/builtin/pypy/pypy3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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"]
Expand All @@ -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"""
Expand Down

0 comments on commit 5144e6a

Please sign in to comment.