Skip to content

Repo checker: PyTorch's index also serves numpy, pillow and triton, but the page answers them from PyPI and offers no fix for any row #236

Open

Description

@patrickballard

Since #233 a requirements file whose only other index is PyTorch's (--extra-index-url https://download.pytorch.org/whl/...) is looked up on PyPI, and torch, torchvision and torchaudio are shown as unknown. PyTorch's index serves many more packages than those three. Its cu128 page lists 113 projects, among them numpy, pillow, markupsafe, jinja2, requests, triton, networkx, sympy and dozens of nvidia-* packages. The cpu page has numpy, pillow, markupsafe, jinja2, triton and requests too. The page answers all of those from PyPI as if that were certain.

It matters, because the installers don't take them from PyPI alone. pip looks at both indexes and picks the best file it finds on either of them. uv's default index strategy takes each package from the first index that has it, and an --extra-index-url comes before the default index (uv docs). So uv pip install -r requirements.txt takes numpy only from download.pytorch.org, whatever PyPI has.

A real case: keras-team/keras's requirements.txt has --extra-index-url https://download.pytorch.org/whl/cpu and -r requirements-common.txt, which lists numpy, scipy, pillow, pandas and more. deepfakes/faceswap's requirements/requirements_cpu.txt has the same line and includes numpy>=2.4.0,<2.5.0 and pillow>=12.2.0.

A second problem: every row of such a file gets lookup: false, so the page offers no fix for any of them, including packages the PyTorch index doesn't have. Run with wheelgap 0.13.0, as the worker does: a file with the PyTorch line, numpy==1.26.4 and pyyaml==6.0.3, checked for 3.15 on linux-x86_64, gives source for both, each with "lookup": false. pyyaml 6.0.4 has the wheel, but the page never says so. The cause is origin.known_pypi(), which needs source.pypi_only, and that is false for any file with an index line.

Where

  • PUBLIC_EXTRA_INDEXES in site/check/driver.py: "download.pytorch.org": frozenset({"torch", "torchvision", "torchaudio"}).
  • _lookups() and check() in the same file: extra_pkg_hosts marks a row unknown with its reason. on_pypi and lookup are set from origin.known_pypi().
  • renderVerdict() in site/check/check.mjs already lists the rows that carry the reason in its "also installs from" alert.

What to do

  • Replace the three names with the names the index serves: the union of the project lists on its pages (/whl/cpu/, /whl/cu1xx/, /whl/rocm.../, /whl/xpu/), as canonical names. Keep the list in driver.py (or a JSON file beside it) with a comment saying the date it was read and how to read it again. A small script in scripts/ that prints the list is welcome, but nothing at run time fetches it.
  • Every row whose name is on that list is unknown, with today's reason (may be installed from download.pytorch.org, which this page doesn't read).
  • A row whose name isn't on the list is answered from PyPI, as now, and gets lookup: true when it was found on PyPI. Its name was already sent to pypi.org for the check, so the fix lookup sends nothing new.
  • Keep every rule from Repo checker: a requirements.txt with PyTorch's --extra-index-url ends in "No packages were checked" #219 that keeps a file private: other hosts, --index-url, --find-links, settings files, quotes and $ in option lines.

Done when:

  • tests/test_check_driver.py: a keras-shaped file (the cpu line, -r of a file with numpy, scipy and pillow): numpy and pillow are unknown with the reason, and scipy is checked with lookup: true.
  • tests/test_check_driver.py: fixes() answers for a gap in a package the index doesn't serve (the pyyaml example above), and gives nothing for one it does.
  • A test that the list is canonical, sorted and holds torch, numpy and pillow.
  • test_a_private_index_package_is_never_looked_up_on_pypi and the Repo checker: a requirements.txt with PyTorch's --extra-index-url ends in "No packages were checked" #219 tests pass unchanged.
  • In the PR: keras-team/keras before and after, as screenshots.

Activity

  1. added
    bug
    help wanted
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions