feat: add --merge-with to merge with remote PEP 503 index (#133) - #135
Draft
aiolibsbot wants to merge 3 commits into
Draft
feat: add --merge-with to merge with remote PEP 503 index (#133)#135aiolibsbot wants to merge 3 commits into
aiolibsbot wants to merge 3 commits into
Conversation
Fetches the remote simple index (read-only) and appends absolute-URL anchors for any wheel filenames not present locally, so pip can fetch remote-only wheels without ever overwriting them. Local wheels win on filename collisions; remote unreachable falls back to local-only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
flake8 flagged F401 for an unused `from . import FIXTURES` in tests/test_remote_index.py, and bandit re-flagged B310 on the urlopen call despite the existing `# noqa: S310` (which is a flake8-bandit marker, not a bandit one). Add `# nosec B310` to silence bandit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
--merge-with URLCLI flag (andmake_index(merge_with=...)kwarg) that fetches a remote PEP 503 simple index and merges its entries into the generated index.Why
Closes #133. The motivating workflow is
rsync-publishing a partial wheel set to a host that already serves other wheels. Without merge support, the next index rebuild would silently drop the remote-only wheels and force unnecessary rebuilds.How
remote_index.pymodule: stdlib-only HTTP +html.parser, no new deps. Returnsdict[canonical_name, list[RemoteEntry]].IndexMakeracceptsmerge_with; remote entries are filtered against the local wheel filename set so local files always win on collisions.generate_project_pagegainedextra_entries; remote-only files are emitted with the absolute remote URL sopipcan fetch them directly.data-requires-python, PEP 658 (data-dist-info-metadata) and PEP 714 (data-core-metadata) attributes are preserved from the remote anchors.Testing
tests/test_remote_index.pywith 7 new tests covering parser, fetcher error path, end-to-end merge, attribute round-trip.🤖 Generated with Claude Code
Quality Report
Changes: 6 files changed, 454 insertions(+), 12 deletions(-)
Code scan: clean
Tests: failed ([Errno 13] Permission denied: 'pytest')
Branch hygiene: 1 issue(s)
Generated by Kōan post-mission quality pipeline