-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH Support alternative index urls (#74)
- Loading branch information
1 parent
930819f
commit 075289c
Showing
13 changed files
with
268 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from .. import package_index | ||
|
||
|
||
def set_index_urls(urls: list[str] | str) -> None: | ||
""" | ||
Set the index URLs to use when looking up packages. | ||
- The index URL should support the | ||
`JSON API <https://warehouse.pypa.io/api-reference/json/>`__ . | ||
- The index URL may contain the placeholder {package_name} which will be | ||
replaced with the package name when looking up a package. If it does not | ||
contain the placeholder, the package name will be appended to the URL. | ||
- If a list of URLs is provided, micropip will try each URL in order until | ||
it finds a package. If no package is found, an error will be raised. | ||
Parameters | ||
---------- | ||
urls | ||
A list of URLs or a single URL to use as the package index. | ||
""" | ||
|
||
if isinstance(urls, str): | ||
urls = [urls] | ||
|
||
package_index.INDEX_URLS = urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+393 Bytes
tests/test_data/pypi_response/fake-pkg-micropip-test_simple.json.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.