pip gets the package in place of its metadata through a pull-through link once the package is cached

オープン
#1,453 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@aevnsvi がすでに取り組んでいます。

2026年10月29日 から。

  • #1454 @aevnsvi による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

  1. A distribution with a Python repository and a PyPI remote (pull-through).
  2. On simple/<project>/, take the link of a wheel that is not cached yet; it carries
    ?redirect= and announces metadata.
  3. GET the link: the wheel is downloaded and added to the repository.
  4. GET the same link with .metadata appended: 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.

主要言語
Python
スター
49
フォーク
92
平均マージ
23時間 45分
マージ済み PR(30日)
38

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pulp/pulp_python のほかの issue

pulp/pulp_python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。