-
Notifications
You must be signed in to change notification settings - Fork 179
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
ImportError
when running tests (with editable installs)
#1491
Comments
Note that this error happens only when running |
User on Telegram had this problem when trying JM on FreeBSD. So, this looks like an issue we will need to address soon. |
#1484 adresses it. Just let me know if I can do anything to make review easier. |
I recreated the virtualenv and tests pass for me locally with my usual manual procedure (i.e., without using EDIT: do I need a specific version of something to reproduce this? |
Yes, I think so, seems to be related to version of setuptools. |
For the record, I'm using |
AFAIK We could use the transitional compat mode but it will be removed in future versions of setuptools. As such it makes more sense to transition to modern packaging (PEP517, PEP518, etc) soonest possible. References: https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior |
I think something like #1484 is good even without considering this issue. |
I've spent some time trying to diagnose this (apart from just being a weird bug, it's a big blockage to doing dev work). I was replicating the issue on three different environments, one my home laptop, the other two VMs (Ubuntu 2004 and Debian 5.10), and after messing around a lot with versions of pytest, setuptools and a few other things, it seems like I pinned it down to the So taking
(originally i was doing But I noticed that on my old JMCS install on my laptop, it works and so I changed various versions. The change in pip version seemed to fix it on all 3 enviroments as above (and as noted, py3.8 and 3.9):
I would note, however, something strange: one of my VMs had defaulted to pip 20.3, whereas the other (the ubuntu one) has 23.x.x, i.e. this version is between the two versions that both didn't work. But with this change, the editable installs still allow pytest to work:
If other people can replicate that it's fixed by pinning the pip version, we could put it into |
This was first reported by @roshii in #1479. Initially I couldn't reproduce, but at one moment, after recreating jmvenv also started having this problem. It's probably related to pypa/setuptools#3504.
For CI opened #1490, which removes
-e
from requirements files before setting up virtual environment there.Should figure out what's happening there, how can this be properly solved.
In worst case scenario, old behaviour of
--develop
setting ofinstall.sh
should be restored. Ability to run tests locally is important, but also in-place editing without reinstall each time is very useful in development.The text was updated successfully, but these errors were encountered: