Skip to content

Add support for Simple Repository API (PEP 503 / PEP 691) - #75

Merged
ryanking13 merged 14 commits into
pyodide:mainfrom
ryanking13:simple-api
Jul 25, 2023
Merged

Add support for Simple Repository API (PEP 503 / PEP 691)#75
ryanking13 merged 14 commits into
pyodide:mainfrom
ryanking13:simple-api

Conversation

@ryanking13

@ryanking13 ryanking13 commented Jul 19, 2023

Copy link
Copy Markdown
Member

This adds support for Simple Repository API including PEP 691 and PEP 503.
This PR also changes the default index URL from https://pypi.org/pypi/{package_name}/json to https://pypi.org/simple.

I added some tests that send requests to remote package indexes like PyPI, so we can ensure that micropip "works" with famous package indexes. Those tests don't run by default in CI, but one can run them manually by adding --remote-remote-index-tests flag or by clicking the button in GHA.

  • changelog

@ryanking13 ryanking13 mentioned this pull request Jul 19, 2023

@rth rth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks @ryanking13 ! I have only one minor comment otherwise LGTM.

I think once this is merged we should do a micropip release with it. Unless there were other PRs you wanted to do in this area.

Comment thread micropip/package_index.py
from .externals.mousebender.simple import from_project_details_html

DEFAULT_INDEX_URLS = ["https://pypi.org/pypi/{package_name}/json"]
DEFAULT_INDEX_URLS = ["https://pypi.org/simple"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm we are never actually downloading the top level index here, because it's >3MB compressed in the case of PyPI.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I can confirm that we are not downloading the top level index, unless someone changes the index URL to https://pypi.org and do micropip.install("simple") :)

@ryanking13

ryanking13 commented Jul 25, 2023

Copy link
Copy Markdown
Member Author

I think once this is merged we should do a micropip release with it. Unless there were other PRs you wanted to do in this area.

Yes, let's make a release so we can include it in Pyodide 0.24.

@ryanking13
ryanking13 merged commit 44df054 into pyodide:main Jul 25, 2023
@ryanking13
ryanking13 deleted the simple-api branch July 25, 2023 12:52
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.

2 participants