Python Remote URL construction incorrectly appends `/simple/`, breaking Gitea PyPI integration
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Start by tracing the Python remote URL construction logic that appends /simple/; no source file or test path is identified in the issue. Reproduce both Gitea URL cases, then add coverage showing that a complete /simple/ URL is requested unchanged and that the resulting requests no longer return 404.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Version
- Pulp Operator:
v1.0.0
Describe the bug
The pulp-python plugin unconditionally appends the /simple/ suffix to the url provided for a Python remote. This behavior is hardcoded and assumes the remote URL points to a repository root that needs /simple/ added to reach the PEP 503 index.
This assumption breaks compatibility with PyPI-compatible registries like Gitea, where the complete, non-modifiable simple index URL is already provided. The forced suffix leads to incorrect URL generation.
To Reproduce
* Gitea Instance with a PyPI Registry: e.g., https://gitea.example.xyz
* Target Gitea PyPI URL: https://gitea.example.xyz/api/packages/example/pypi/simple/
-
Attempt 1: Provide the full, correct URL ending in
/simple/pulp python remote create \ --name gitea-remote-full \ --url https://gitea.example.xyz/api/packages/example/pypi/simple/ \ --username <user> \ --password <pass> pulp python repository create --name test-repo-1 pulp python repository sync --name test-repo-1 --remote gitea-remote-full -
Attempt 2: Provide the URL without the
/simple/suffixpulp python remote create \ --name gitea-remote-base \ --url https://gitea.example.xyz/api/packages/example/pypi \ --username <user> \ --password <pass> pulp python repository create --name test-repo-2 pulp python repository sync --name test-repo-2 --remote gitea-remote-base
Pulp's automatic suffixing logic causes 404 errors in both scenarios.
-
In Attempt 1, Pulp appends an extra
/simple/, resulting in a "double suffix":- URL requested:
https://gitea.example.xyz/api/packages/example/pypi/simple/simple/ - Result:
404 Not Found.
- URL requested:
-
In Attempt 2, Pulp strips the last path segment (
/pypi) and appends/simple/, also forming an incorrect URL:- URL requested:
https://gitea.example.xyz/api/packages/example/simple/ - Result:
404 Not Found.
- URL requested:
Expected behavior
Pulp should respect the provided url for a Python remote. When a URL is provided, Pulp should either:
a. Use the URL as-is, without modification.
b. Check if the URL already ends with /simple/ and, if so, refrain from appending it again.
For the configuration in Attempt 1, Pulp should make requests directly to https://gitea.example.xyz/api/packages/example/pypi/simple/.
Additional context
This behavior makes it impossible to use Gitea as a PyPI remote source for Pulp. More broadly, it limits Pulp's compatibility with any PyPI-compliant repository that provides a full, unchangeable URL to its simple index and does not conform to the exact .../ -> .../simple/ transformation that Pulp enforces.
A fix should be relatively easy: Modify the URL construction logic to first check if url.endswith('/simple/'). If true, use the URL as-is
This would provide the necessary flexibility to integrate with a wider range of non-standard but popular PyPI-compatible endpoints like Gitea.
- Vorherrschende Sprache
- Python
- Sterne
- 49
- Forks
- 88
- Ø Merge
- 1 T. 10 Std.
- Gemergte PRs (30 T.)
- 31
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pulp/pulp_python
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
pulp/pulp_python#1381 ·
-
Feature Triage-Needed
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
pulp/pulp_python#1371 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 45/100
pulp/pulp_python#1360 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
pulp/pulp_python#1358 ·
-
Feature
pulp/pulp_python#1340 · 1 zugewiesene Person ·
Alle Issues in pulp/pulp_python
Ähnliche Issues
-
documentation help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
simonw/sqlite-utils#872 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100