feat: virtual PyPI repos can merge local + remote members
The virtual engine now detects local members (repo_type=local) and generates their package index in-memory instead of trying to fetch from a non-existent upstream. - MemberIndex gains RepoType field so mergers use correct URL prefix (/api/v1/local/ vs /api/v1/remote/) - Virtual engine accepts a LocalIndexGenerator interface for producing local PyPI indexes - LocalHandler implements GeneratePyPIPackageHTML for reuse by both the direct serving path and the virtual merger - Includes local PyPI upload support (cherry-picked from benvin/local-pypi) Tested e2e: local wheel upload + virtual merge + uv pip install from both direct local and virtual URLs
This commit is contained in:
@@ -36,8 +36,13 @@ func (m *PyPIMerger) MergeIndexes(members []MemberIndex, proxyBaseURL string) ([
|
||||
}
|
||||
|
||||
if proxyBaseURL != "" && href != "" {
|
||||
href = fmt.Sprintf("%s/api/v1/remote/%s/%s",
|
||||
routePrefix := "remote"
|
||||
if member.RepoType == "local" {
|
||||
routePrefix = "local"
|
||||
}
|
||||
href = fmt.Sprintf("%s/api/v1/%s/%s/%s",
|
||||
strings.TrimRight(proxyBaseURL, "/"),
|
||||
routePrefix,
|
||||
member.RemoteName,
|
||||
strings.TrimLeft(href, "/"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user