-
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
pip install -e crashes on Python 3.8 when 'typing' is installed from PyPI because it runs a sub-command in such a way that site-packages comes before lib/python3.8 #8272
Comments
I think this might just be a duplicate of #8214 ? |
It is indeed.
When you say "it used to", when was the last time it worked? My feeling is that it would not have worked since we introduced build isolation. Does that match your experience? |
It worked in every version prior to 20.1, so 20.0.2. |
Thanks, that's useful to know. |
Gah, this is likely a regression, since nearly all of pip's code avoids importing typing as much as possible. I'm curious how this slipped through, but we can look into this separately. Looks like another bugfix release is needed. :( |
It looks like #5841 introduced this, triggering the issue with how we set |
I'm now inclined to accept #8213 as a fix for this. It's a bit of a hack, but so's all of the code in this area, and now that we understand what's going on, and have confirmation that it's affecting things more widely than the original report suggested, it seems better to apply that fix and worry later about cleaning up |
Ah sorry, you're right. I was too quick in my comment - indeed #8213 breaks #5841, I was reading the conditional wrongly. I still think we need to understand the problem better, and I don't think the issue is urgent enough to need another bugfix release (all of the reproducers I've seen involve installing a backport module in a Python release that doesn't need it - so "don't do that" seems like a sufficient workaround for the immediate term). One thing that bothers me - although I haven't tested anything myself - is that this is reported as working in 20.0.2, which is odd as #5841 was included from 19.0, and the |
Yea, that makes sense to me! :) |
Possibly related mypy-extensions https://pypi.org/project/typing-extensions/#history 3.7.4.2 on Apr 2nd, 2020
https://github.com/python/typing/commits/3.7.4.1/typing_extensions/setup.py |
Aggregating the conversation into #8214, which contains more context (with PRs linked to it). |
To prevent pypa/pip#8272 downstream.
This prevents shadowing the version of the module that comes with the stdlib since Python 3.5. Quoting from the package pypi site (https://pypi.org/project/typing/): "For package maintainers, it is preferred to use typing;python_version<"3.5" if your package requires it to support earlier Python versions. This will avoid shadowing the stdlib typing module when your package is installed via pip install -t . on Python 3.5 or later." Incidentally, this fixes some bug caused by the two versions of typing coexisting that arises in some versions of Python 3.7, see e.g.: pypa/pip#8272 https://travis-ci.community/t/python-3-7-and-3-8-builds-are-failing-attributeerror-type-object-callable-has-no-attribute-abc-registry/10900
Environment
Description
pip install -e
fails with a traceback if thetyping
module is installed from PyPI.Expected behavior
It should work, like it used to.
How to Reproduce
Output
The text was updated successfully, but these errors were encountered: