-
Notifications
You must be signed in to change notification settings - Fork 153
Docs: add guide for mirroring from another Simple API mirror #2144
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Mirror from a mirror (Simple API) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ================================= | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Bandersnatch can mirror packages from another Python package index that | ||||||||||||||||||||||||||||||||||||||||||||||||||
| implements the Simple Repository API (PEP 503). This allows you to create | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Please mention PEP691 as this is what defines the JSON we rely on :) |
||||||||||||||||||||||||||||||||||||||||||||||||||
| a secondary mirror from an existing mirror instead of directly from PyPI. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Configuration | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Set the ``master`` option in your bandersnatch configuration to the base | ||||||||||||||||||||||||||||||||||||||||||||||||||
| URL of the upstream mirror. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Example:: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| [mirror] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| master = https://example-mirror.org/simple/ | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Notes | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ----- | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - The upstream mirror must implement the Simple Repository API (PEP 503). | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - The upstream mirror must implement the Simple Repository API (PEP 503). | |
| - The upstream mirror must implement the Simple Repository API, supporting both: | |
| - PEP 691 JSON responses for the Simple API via ``Accept: application/vnd.pypi.simple.v1+json``. | |
| - PyPI's JSON project metadata API at ``/pypi/<project>/json``. |
Copilot
AI
Feb 10, 2026
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.
The master setting here is documented as pointing at the upstream /simple/ endpoint, but Bandersnatch’s Master.simple_url appends /simple to the configured base URL. Setting master = https://example-mirror.org/simple/ will result in requests to .../simple//simple and break mirroring; document master as the upstream base (e.g. https://example-mirror.org) and remove the “URL ends with /simple/” guidance.
| URL of the upstream mirror. | |
| Example:: | |
| [mirror] | |
| master = https://example-mirror.org/simple/ | |
| Notes | |
| ----- | |
| - The upstream mirror must implement the Simple Repository API (PEP 503). | |
| - Ensure the URL ends with ``/simple/``. | |
| URL of the upstream mirror (for example, ``https://example-mirror.org``). | |
| Example:: | |
| [mirror] | |
| master = https://example-mirror.org | |
| Notes | |
| ----- | |
| - The upstream mirror must implement the Simple Repository API (PEP 503). | |
| - Bandersnatch will append ``/simple`` to the configured ``master`` URL. |
Copilot
AI
Feb 10, 2026
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.
The PR description mentions “Notes about JSON Simple API vs HTML”, but the content here doesn’t explain the PEP 691 JSON vs PEP 503 HTML distinction or what happens if the upstream only serves HTML. Consider adding a short note under “Notes” describing the required content-negotiation/JSON support and any fallback options (e.g., using api-method = xmlrpc where applicable).
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 new doc page isn’t linked from the main docs
toctree(e.g.docs/index.rst), so it may not be discoverable or included in the built documentation. Please add it to an appropriatetoctreeso it appears in navigation/output.