Skip to content

feat(pypi): support PEP 691 JSON Simple API responses - #1

Open
Aniket1827 wants to merge 1 commit into
mainfrom
akurkute-clean
Open

Aniket1827 wants to merge 1 commit into
mainfrom
akurkute-clean

Conversation

@Aniket1827

Copy link
Copy Markdown
Collaborator

Some package indexes return JSON for Simple API pages even when text/html is requested. Extend parse_simpleapi_html to detect JSON responses and parse them via a new _parse_simpleapi_json helper, handling package file lists, index pages, yanked entries, and core-metadata/dist-info-metadata.

Add unit tests for JSON sdist, wheel with metadata, yanked entries, and index parsing.

feat(pypi): support PEP 691 JSON Simple API responses

Some package indexes (e.g. JFrog Artifactory) return a JSON response for
Simple API pages even when Accept: text/html is requested, ignoring
content negotiation. Without this change, rules_python fails to parse
those responses.

Extend parse_simpleapi_html to detect PEP 691 JSON responses by
checking if the content starts with {, and delegate to a new
_parse_simpleapi_json helper. The helper handles package file lists,
index pages, yanked entries (PEP 592), and core-metadata/
dist-info-metadata fields (PEP 714).

Added unit tests for JSON sdist, wheel with metadata, yanked entries, and
index parsing.

Some package indexes return JSON for Simple API pages even when
`text/html` is requested. Extend `parse_simpleapi_html` to detect JSON
responses and parse them via a new `_parse_simpleapi_json` helper,
handling package file lists, index pages, yanked entries, and
`core-metadata`/`dist-info-metadata`.

Add unit tests for JSON sdist, wheel with metadata, yanked entries,
and index parsing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant