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

Add update message to UnsupportedWheel exception message #13034

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jamestwebber
Copy link

Inspired by the discussion for PEP 777. This is a small change to pip's output when it encounters a wheel with a major version higher than it can currently handle. The existing message simply stated it was incompatible, the PR changes this to suggest updating pip.

There is a sort of chicken-or-egg problem here in that updating pip won't fix the problem until a new wheel version is supported. But on the other hand, there's no way for someone to try installing a 2.0 version wheel until one actually exists, so it seems unlikely that they will encounter this message until said wheels are being uploaded to PyPI.

added update nudge to UnsupportedWheel exception
@jamestwebber jamestwebber marked this pull request as ready for review October 21, 2024 03:09
@jamestwebber
Copy link
Author

Updated this to main just for the heck of it. The value of this PR is directly related to how long it's around, so it'd be great to get it into the January release!

@jamestwebber jamestwebber mentioned this pull request Jan 20, 2025
@sbidoul
Copy link
Member

sbidoul commented Jan 25, 2025

Thanks @jamestwebber I'm not entirely convinced by this formulation, because there is no guarantee that upgrading pip will result in a successful install.

Perhaps could we say Consider upgrading pip to a more recent version that supports the Wheel X format. ? Or reverse the formulation to say This version of pip does not support Wheel format version X. ?

@pfmoore
Copy link
Member

pfmoore commented Jan 25, 2025

I don't think we can second-guess what might be in a new wheel format. For example, if it requires zstd compression, upgrading pip might be enough1. Or there may be alternative workarounds, like --no-binary.

I'd rather just rely on stating the facts, and assume that the people designing the new wheel format will make sure to publish enough information to ensure that web searches for "Why can't I install Wheel 2.0 with pip?" will lead to useful answers. After all, we're lucky in this case that there's not an existing body of wrong answers that we'd have to compete with.

Footnotes

  1. You might need a Python version with zstd support in the stdlib.

@jamestwebber
Copy link
Author

As another response to the DPO discussion, I had also opened an issue related to this on the packaging website: pypa/packaging.python.org#1621

Maybe resolving that issue first, and establishing a canonical URL for wheel version questions (even if it's uninformative for now), would lead to a better path for this PR.

@pfmoore
Copy link
Member

pfmoore commented Jan 26, 2025

I was thinking more of just seeding Stack Overflow with good questions and answers. I don’t think the PUG is a particularly good fit for user support questions like this.

@jamestwebber
Copy link
Author

Perhaps, but it's still a chicken-and-egg question. I opened that issue based on your suggestion. 😂

@pfmoore
Copy link
Member

pfmoore commented Jan 26, 2025

Ah, I wondered if I'd said something elsewhere, but couldn't find the link. But if you read the whole of my post, you'll note that I question what any such linked document could usefully say.

Honestly, I think that it's premature to try to give users any sort of "how to fix this" advice at this point. I appreciate the motivation here, but this is exactly the same issue as any other backward incompatible change has to deal with. Given that we don't know how (or if!) a transition to a new wheel version will even happen yet, I think we should wait, at least until there's an actual proposal for wheel 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants