pip gets the package in place of its metadata through a pull-through link once the package is cached
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 20/100
Direzione di ricerca
Read the linked pull request #1454, which follows this report. The issue identifies Distribution.content_handler() and PythonRemote.get_remote_artifact_url() as relevant entry points; understand how pull-through links announce PEP 658 metadata and how the proposed change handles them. Done means pip no longer receives a package where it expects metadata after the package has been cached.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version
pulp_python 3.36.2 with pulpcore 3.120.0; the same code is on main.
Describe the bug
For a package that is not in the repository yet, the simple page links
<base>/<file>?redirect=<upstream URL> and announces its PEP 658 metadata on that
link (data-core-metadata / core-metadata). pip builds the metadata URL by
appending .metadata to the whole link, so the suffix lands in the redirect
parameter and the path still names the package:
<base>/<file>?redirect=<upstream URL>.metadata.
PythonRemote.get_remote_artifact_url() handles that form, but only on the
pull-through branch of the content handler. When the package is already in the
repository, because another client fetched it in the meantime, the handler finds it
by its path first and answers the metadata request with the package itself. pip then
fails the metadata's hash check. A client gets into this whenever it read the simple
page before the package was cached, for example two CI jobs installing the same new
package at the same time.
To Reproduce
- A distribution with a Python repository and a PyPI remote (pull-through).
- On
simple/<project>/, take the link of a wheel that is not cached yet; it carries
?redirect=and announces metadata. - GET the link: the wheel is downloaded and added to the repository.
- GET the same link with
.metadataappended: the response is the wheel (its sha256),
not the metadata.
Expected behavior
A link either announces metadata that is served at the URL pip derives from it, or
announces none.
Additional context
Fixing it on the serving side would need the query string where the package is looked
up by path, which Distribution.content_handler() does not get. Not announcing
metadata on pull-through links avoids the request altogether: installers fall back to
the metadata in the package they download, and once the package is in the repository
its local link has no query string and announces the metadata again. A pull request
doing that follows.
- Lingua principale
- Python
- Stelle
- 49
- Fork
- 92
- Merge medio
- 23h 45m
- PR unite (30g)
- 38
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pulp/pulp_python
-
Pull-through: pip gets the wheel instead of its PEP 658 metadata (or the reverse), hash mismatchForse già presa @gerrod3 l’ha presa 39 giorni fa. ApertaIssue
Difficoltà 5/5 Più di una settimana Idoneità per principianti 22/100
pulp/pulp_python#1428 ·
I maintainer di solito rispondono entro 2 giorni
-
Issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
pulp/pulp_python#1219 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
pulp/pulp_python#1005 ·
I maintainer di solito rispondono entro 2 giorni
-
Feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
pulp/pulp_python#999 ·
I maintainer di solito rispondono entro 2 giorni
-
Implement PEP-708 - Extend the repository API to mitigate "dependency confusion" attacksForse già presa @gerrod3 l’ha presa 374 giorni fa. ApertaFeature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
pulp/pulp_python#998 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di pulp/pulp_python
Issue simili
-
Triage-Needed
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pulp/pulp-oci-images#875 ·
-
intake mcp-intake needs-human-review priority:high type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Ikalus1988/MisakaNet#5718 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
facebookresearch/autoform-bot#872 ·
I maintainer di solito rispondono entro 1 giorno
-
Dataset.to_json() writes "Value": [] for an empty sequenceForse già presa @DG47 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
area: docs area: providers/oci priority: p3 size: S type: documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
finos/open-resource-broker#933 ·
I maintainer di solito rispondono entro 1 giorno