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

20b1: problems with editable installs #1517

Closed
mgedmin opened this issue Jan 29, 2020 · 4 comments
Closed

20b1: problems with editable installs #1517

mgedmin opened this issue Jan 29, 2020 · 4 comments

Comments

@mgedmin
Copy link

mgedmin commented Jan 29, 2020

I've decided to try running tox on all the Python projects I maintain with virtualenv 20.0.0b1, to check for regressions in the new beta. Three of the projects failed, all on Python 2.7:

  • gtimelog (python: No module named gtimelog)
  • irclog2html (ImportError: No module named zope.testrunner)
  • zodbbrowser (ImportError: No module named zope.testrunner)

Here's how to reproduce the gtimelog issue:

I expect: no output, the import should succeed.

I get

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named gtimelog

The --no-deps to pip install is there to make the test simpler and faster; I get the same failure if I do a full pip install -e gtimelog.

I'll create a separate bug for the irclog2html/zodbbrowser issue (they're the same issue): #1518.

I'm on Ubuntu 19.10. I installed virtualenv 20.0.0b1 with pipx install --pip-args=--pre using my system Python 3.7. pipx runpip virtualenv list produces

Package            Version 
------------------ --------
appdirs            1.4.3   
filelock           3.0.12  
importlib-metadata 1.5.0   
pip                20.0.2  
pkg-resources      0.0.0   
setuptools         45.1.0  
six                1.14.0  
virtualenv         20.0.0b1
wheel              0.34.1  
zipp               2.1.0   
@mgedmin
Copy link
Author

mgedmin commented Jan 29, 2020

One difference between virtualenv-created-with-20b1 and virtualenv-created-with-15 appears to be in sys.path: the working virtualenv has ~/src/gtimelog/src in it, the non-working one doesn't.

They both have identical easy-install.pth files in site-packages, and they both have identical gtimelog.egg-link files.

Could it be that the core problem with both this and #1518 is that *.pth files are not processed in the virtualenv's site-packages directory in virtualenvs created with 20b1 on Python 2.7?

@gaborbernat
Copy link
Contributor

@mgedmin we no longer ship our own site.py but rather use the host site.py, so in theory, it well could be that Ubuntu decided to not honour pth files in their site.py which causes the issue. This also explains why I can't reproduce this on macOS.

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Jan 29, 2020
If the host platfrom and pure library paths differed from the
distutils installs ones, we patched the sys.path by appending the
missing paths, this did not trigger the pth processing though.
Changed to use the site.add_site_dir to solve the problem.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@gaborbernat
Copy link
Contributor

I think #1521 solves this. Please can you validate?

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Jan 29, 2020
If the host platfrom and pure library paths differed from the
distutils installs ones, we patched the sys.path by appending the
missing paths, this did not trigger the pth processing though.
Changed to use the site.add_site_dir to solve the problem.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Jan 29, 2020
If the host platfrom and pure library paths differed from the
distutils installs ones, we patched the sys.path by appending the
missing paths, this did not trigger the pth processing though.
Changed to use the site.add_site_dir to solve the problem.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@mgedmin
Copy link
Author

mgedmin commented Jan 29, 2020

Yes, #1521 fixes this.

gaborbernat added a commit to gaborbernat/virtualenv that referenced this issue Jan 29, 2020
If the host platfrom and pure library paths differed from the
distutils installs ones, we patched the sys.path by appending the
missing paths, this did not trigger the pth processing though.
Changed to use the site.add_site_dir to solve the problem.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
gaborbernat added a commit that referenced this issue Jan 29, 2020
If the host platfrom and pure library paths differed from the
distutils installs ones, we patched the sys.path by appending the
missing paths, this did not trigger the pth processing though.
Changed to use the site.add_site_dir to solve the problem.

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants