-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Update test suite to use virtualenv >= 20.0.0 #11288
Conversation
326238a
to
a119531
Compare
5aa8f00
to
6601dd5
Compare
FWIW, I've been looking into this as well (https://github.com/pradyunsg/pip/tree/improve-test-isolation), although I'm trying there to move us off of virtualenv entirely and that involves getting the venv-based setup to be at-parity with the existing virtualenv-based setup (which it's not). I've still not gotten all the tests to pass locally though, so I didn't file a PR for that yet. 😅 |
My current impression is if we manage to get new virtualenv to work, we should be very close with replacing it altogether with venv. The main blocker to |
Yea, that's my understanding as well. I figured that it's not that big of a hop to try complete removal in the first shot -- the problems that need to be solved are roughly the same and it removed the conditionals for which "venv backend" we're using, which I was found were making it difficult for me to keep track of what's happening in the code. The thing that I last struggled with is that the code was still picking up the IIRC, a bunch of tests rely on the virtualenv having user-site visible -- which isn't a problem since we have the isolate fixture which makes the user's home directory point to a temp directory, during the pip execution. I think I hit this as part of working on that branch as well. 😅 |
6f35009
to
81d7bcf
Compare
Typo? Sorry, I couldn't work out what the correct PEP number was. |
I'm gonna guess that was supposed to be https://peps.python.org/pep-0405/ (for |
@uranusjr @pradyunsg By reading the above and looking at the number of failing tests it seems you have a good sense of what needs to be done and have made good progress. With the RM hat on, I'm trying to get a feeling of when I'll push 22.2.1 out and if it should wait for this in order to have more assurance that everything works fine on Python 3.11. So no pressure at all, of course, but if you have hints to share about your plans regarding this topic that'll help me. |
Don’t let this block the release. This doesn’t need to be tied to one since the changes should be only in the test suite (aside from trivial renames). |
I missed this mention, but yea, this doesn’t block a bug fix. It’s more a logistical item needed for testing 3.11 and for reducing long term pain in this space. |
81d7bcf
to
7fd2ebc
Compare
The main changes are made to accomodate bad interactions between distutils and the new virtualenv hacks. Since old virtualenv only does not work in modern Python versions, I decided to only use new virtualenv with Python 3.10 and later and leave the old test setups as-is. A few tests also have the same distutils issues due to relying on |
3437785
to
ef34fee
Compare
I think this actually works now; the only failure is the submodule one. The modern virtual environment structure does not allow us to enable "fake user site" while disabling the global site, so we need to do more fine-grained configuration to correctly set up test environments for each test case. With this done, we can also properly support the stdlib venv ad the test environment backend, since it basically works identically with modern virtualenv. The |
Well they are. At least not "regular" anymore.
Co-Authored-By: Lumir Balhar <lbalhar@redhat.com>
pip uses distutils (instead of sysconfig) for Python < 3.10, which has awkward path issues when faking a user site.
The old INITools tests rely on setup.py, which relies on distutils and generates a ton of issues. Build fake wheels directly to avoid dealing with them.
The modern virtual environment structure does not allow us to enable "fake user site" while disabling the global site, so we need to do more fine-grained configuration to correctly set up test environments for each test case. With this done, we can also properly support the stdlib venv ad the test environment backend, since it basically works identically with modern virtualenv. The incompatible_with_test_venv is thus removed.
ef34fee
to
50e194f
Compare
Let’s restart #7718, we must do this before 3.11 is out.
This is mostly #8441 re-applied to main with some very minor changes.