-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Add RFC9457 support problem details handling #13620
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
base: main
Are you sure you want to change the base?
Conversation
pre-commit.ci autofix |
5b2a653
to
a7ad0f5
Compare
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Hello! Thanks again for following up! I regret to inform you that we currently have limited capacity to review contributions, so it may take some time until we are able to review your PR. We would appreciate your patience. I take it as there are no publicly available indices that provide RFC 9457 error responses? |
Also, it wasn't clear to me from the DPO discussion that is ready for implementation, should this not be a packaging PEP first and gain community consensuses? @pfmoore |
I agree, I think we should probably wait until this is a standard before implementing it here. Or at least until PyPI implements it (there's a possibility that PyPI won't wait for a standard, and if something is available in PyPI there's a decent justification for us implementing it anyway - but that would be on a case by case basis). |
@luisgcoding thanks for the PR but I'm marking it as draft for now. I guess either:
|
Thank you for the information @ichard26 . You are right as far as I know there are no public registries that support RFC9457 responses yet. |
Thanks for the feedback @notatallshaw I understand the concern about implementing this before there's concrete adoption. A few questions to help me determine the best path forward:
Happy to keep this as a draft and coordinate with the appropriate stakeholders before moving forward. |
I would strongly suggest working towards a standard. Even if PyPI implement this without a standard, I'd be cautious about implementing it in pip (my comment above wasn't intended to endorse the idea of us implementing this without a standard, just to note that it was possible). There's already a discussion on discuss.python.org, so the process to start working towards a PEP is to continue the discussion there, and offer to write a PEP 🙂 |
This PR adds support for RFC 9457 (Problem Details for HTTP APIs), enabling pip to parse and display structured error responses from package indexes that implement this standard.
What Changed
Implementation Details
When pip receives an HTTP error response with Content-Type:
application/problem+json
, it:Non-RFC 9457 responses continue to use the existing NetworkConnectionError behavior.
Based on this discussion in the forum, this implementation could potentially lead to a PEP proposal. This PR is intended to start the conversation with the pip maintainers about adopting RFC 9457 support in the packaging ecosystem.