Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PyPy3 Windows stlib path #2072

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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