-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Switch install scheme backend to sysconfig #10358
Conversation
0d6c892
to
443533a
Compare
Side note: CPython currently has an unresolved bug that installs user-site platform-dependent packages ( |
443533a
to
cb411c2
Compare
Do we need to wait for python/cpython#27655 to be released then? https://github.com/pypa/pip/runs/3321341848#step:5:2976 seems to be an esoteric error. :/ |
Huh, what the hell? This also seems to be a pretty environment-specific thing—the Windows tests are all passing, including the 3.10 ones. |
Gonna move the failure output to a comment, in case it's useful for future reference; and re-running the build.
|
Maybe @brettcannon has an idea of what's up? CPython seems to be failing to compile this content to bytecode: Lines 258 to 266 in b9f8295
|
Definitely not a flaky failure. :/ |
Is the code marshalled on the fly or somehow checked into the repo? If it's the former it may be a bug, if it's the latter then it's probably due to the marshal format being changed. I know Guido and the perf team have been poking around in marshal lately but I don't know if any of their PRs landed upstream in 3.10. |
There's no marshal'd contented checked in to this repository. This file is generated on each test run, and compiled using
The contents are from the link above, and can be confirmed in the "showlocals" output from pytest, that's augumented the traceback. The |
@pradyunsg if you can get a small reproducer then please open a bug at bugs.python.org. |
So I tried compiling CPython from source (I’m not sure the exact version GitHub is using so tested with rc) and this test seems to run fine. Since all we do here is switching from distutils to sysconfig, and all that affects is potentially changing some path values pip uses to install things to, I’m suspecting this is an environment issue. Maybe GHA’s Python setup makes sysconfig point to a different location from distutils that somehow cannot be correctly pycompile-d 😟 |
5abbecb
to
6f6c038
Compare
Err, the paths are the same as far as I can tell? https://github.com/pypa/pip/runs/3373309381#step:5:3012 |
Did a round of debugging by ssh'ing into the GHA runner. Turns out, somehow,
This looks like it's super specific to pip's test suite. The fix for us, will be to change I'd say #9578 has became a bit more important now. :) |
Specifically, the patch is: diff --git a/tests/unit/test_wheel.py b/tests/unit/test_wheel.py
index 3b39f91b97c..863b4ddb011 100644
--- a/tests/unit/test_wheel.py
+++ b/tests/unit/test_wheel.py
@@ -404,7 +404,7 @@ def test_install_prefix(self, data, tmpdir):
self.name,
user=False,
home=None,
- root=tmpdir,
+ root=str(tmpdir),
isolated=False,
prefix=prefix,
) |
We really should switch to |
I do wonder why the class suddenly becomes unmarshallable though. Were we depending on some internals we shouldn’t (and 3.10 exposes our mistake), or is 3.10 breaking compatibility intentially? But that’s not pip-related so I’ll do it in my own free time (wait, but I’m doing pip in my free time anyway, what’s the difference). |
41453b5
to
7ed5911
Compare
This is only done for Python 3.10+ so we don't disrupt too many existing pip installations.
7ed5911
to
d1d9bc5
Compare
LOL |
Whoa! How did you get a non-string Path objects never were marshallable – the format doesn't support them. There's a list of supported types in |
@encukou See the comment above - we apparently do Sounds like a bug in Edit: I can't easily find a reproducer, though - is it 3.10 only? |
To clarify, the |
Oh! That's the missing link. I'll file a bpo. Edit: bpo-45127 filed |
Now we’ve weeded out (almost) all the known distutils-sysconfig inompatibilities, let’s make the switch? Installations running on Python 3.9 or lower are not affected. Only Python 3.10 and up will use sysconfig.
Right now I’m targeting 21.3 although this is a bit awkward since CPython 3.10 is scheduled to be released slightly before that. But that’s probably a good thing since we can at least be sure the pip bundled in 3.10.0 is “guaranteed” to work? We can always bundle this switch in the first 3.10.x patch release anyway.