-
Notifications
You must be signed in to change notification settings - Fork 963
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
Implement Alternate Repository Location for PEP 708 #15716
Implement Alternate Repository Location for PEP 708 #15716
Conversation
…ository-location # Conflicts: # warehouse/packaging/models.py
Fixed rendering for detail.html. Moved api mimetypes to const vars. Check delete confirmation name matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really strong and comprehensive start, thank you! I left some notes after an initial review.
Thanks very much for the initial review, @ewdurbin! I'll have a look at the cache keys for the model. |
…pository-location' into feature/add-project-alternate-repository-location # Conflicts: # tests/unit/manage/test_views.py
…ository-location # Conflicts: # warehouse/locale/messages.pot
This allows the migrations to run.
Thanks for picking this up by the way! Really jazzed to see it getting worked on. |
…ository-location # Conflicts: # tests/unit/api/test_simple.py # warehouse/locale/messages.pot
- route_path -> route_url to get full URL rather than path - move self reference to the _simple_detail helper
@ewdurbin That commit to fix tests and make the JSON & HTML apis match makes sense! |
I'm going to hold off for a couple days, but if I don't hear from @dstufft on the two remaining open questions, I will remove the self-reference in alternate-repositories values and merge. The PEP reads as though they can be implied "When using alternate locations, clients MUST implicitly assume that the url the response was fetched from was included in the list." |
The PEP reads as though they can be implied "When using alternate locations, clients MUST implicitly assume that the url the response was fetched from was included in the list."
PyPI's existing meta elements follow a `pypi:` naming convention. Implementation in pypi/warehouse#15716 will follow this convention.
Excellent, thanks @ewdurbin! |
def _update_context(context, content_type, renderer_override): | ||
if renderer_override != "json" or content_type in [ | ||
simple.MIME_TEXT_HTML, | ||
simple.MIME_PYPI_SIMPLE_V1_HTML, | ||
]: | ||
return _valid_simple_detail_context(context) | ||
return context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something, but I think this helper is currently causing the test_with_files_quarantined_omitted_from_index
test to be skipped (since it's an instance method, but it's currently indented into the helper.) I'll send a PR to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #16777 with the fix.
See pypi#15716 (review) Signed-off-by: William Woodruff <[email protected]>
See #15716 (review) Signed-off-by: William Woodruff <[email protected]>
PyPI implemented alternate location for PEP 708. (pypi/warehouse#15716)
PyPI implemented alternate location for PEP 708. (pypi/warehouse#15716)
description=form.description.data, | ||
) | ||
self.request.db.add(alt_repo) | ||
self.request.db.add( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ope, totally missed this in review, but this is pretty incorrect and the cause of #12933 (comment)
Adds per-project Alternate Repository Location as per PEP 708.
Notes:
Relates to #15431
Previews:
HTML:
curl http://localhost/simple/[project_name]/
JSON:
curl -H "Accept: application/vnd.pypi.simple.v1+json" http://localhost/simple/[project_name]/