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

virtualenv.path_locations() report of lib_dir under pypy #306

Closed
qwcode opened this issue Jul 30, 2012 · 6 comments
Closed

virtualenv.path_locations() report of lib_dir under pypy #306

qwcode opened this issue Jul 30, 2012 · 6 comments
Labels

Comments

@qwcode
Copy link

qwcode commented Jul 30, 2012

looks like virtualenv.path_locations() reports wrong lib_dir for current pypy

currently, virtualenv does this:

elif is_pypy:
    lib_dir = home_dir
    inc_dir = join(home_dir, 'include')
    bin_dir = join(home_dir, 'bin')

but take a look at the latest pypy install

bin
include
lib_pypy
lib-python
    2.7
        site.py
        etc..
site-packages

I think lib_dir should do this:

lib_dir = join(home_dir, 'lib-python', py_version)
@pnasrat
Copy link

pnasrat commented Jul 30, 2012

We probably should work out when it changed and have version specific info.

@qwcode
Copy link
Author

qwcode commented Jul 30, 2012

in looking at this more, I think maybe this was intentional, not just a "bug".
I think it's so the simple action of making site-packages = lib_dir + 'site-packages' can be preserved for pypy.
pypy breaks the mold in that's it's site-packages is right below home.
so not a clear cut bug, but still something to fix.
probably, virtualenv.path_locations() should also report site-packages, in addition to lib_dir, so they can be properly be discriminated.

@pradyunsg
Copy link
Member

Is this still unresolved?

@pradyunsg
Copy link
Member

virtualenv.path_locations() should also report site-packages, in addition to lib_dir, so they can be properly be discriminated.

@qwcode @pfmoore @dstufft IFAICT, this is a good way to go forward with this; thoughts?

@pfmoore
Copy link
Member

pfmoore commented Sep 28, 2017

I'm reluctant to expand the exposed API of virtualenv. Longer term, I believe people should be moving to the stdlib venv and virtualenv should either disappear (except to support Python 2.x) or become a thin wrapper around venv. To that end, offering any APIs that venv doesn't provide will make that harder.

Surely the canonical way to get site-packages is sysconfig.get_path('purelib') (or platlib...)? I know it involves invoking the target interpreter, but that seems a reasonable constraint to me.

It's conceivable that there is a need for a library to offer a way to introspect aspects of a Python interpreter, without running that interpreter. It's even conceivable that virtualenv might benefit from using such a library. But I don't think we have the resources to maintain such a library as part of virtualenv (especially given the myriad of special cases that exist - Debian's dist-packages, this PyPI variation, Windows vs Unix bin/scripts distinction, etc).

@stale
Copy link

stale bot commented Jan 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 14, 2019
@stale stale bot closed this as completed Jan 21, 2019
@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants