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

virtualenvs should base site-packages and other directories on sysconfig paths #2095

Closed
charliermarsh opened this issue Feb 29, 2024 · 0 comments · Fixed by #2188
Closed
Assignees
Labels
bug Something isn't working pypy Related to PyPy support

Comments

@charliermarsh
Copy link
Member

Right now, we assume a specific structure for the virtualenvs that we create, and it's necessary (I think?) that this structure matches the sysconfig.get_paths() returned by the interpreter in the virtual environment later. The paths seem to be correct for CPython, but they're not quite right for PyPy, and could be wrong in general for unusual distros.

If you look at virtualenv, my understanding is that it does something like...

@charliermarsh charliermarsh added the bug Something isn't working label Feb 29, 2024
@charliermarsh charliermarsh added the pypy Related to PyPy support label Feb 29, 2024
@charliermarsh charliermarsh self-assigned this Mar 5, 2024
charliermarsh added a commit that referenced this issue Mar 5, 2024
## Summary

This PR migrates our virtualenv creation from a setup that assumes prior
knowledge of the correct paths, to a technique borrowed from
`virtualenv` whereby we use `sysconfig` and `distutils` to determine the
paths. The general trick is to grab the expected paths with `sysconfig`,
then make them all relative, then make them absolute for a given
directory.

Closes #2095.
Closes #2153.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pypy Related to PyPy support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant