Repository navigation
Description
A requirements file that names another index is treated as private from top to bottom: none of its packages is looked up. That is right for a company index. It is a dead end for the most common extra index there is, PyTorch's public one. Paste jhj0517/Whisper-WebUI, whose requirements.txt starts with --extra-index-url https://download.pytorch.org/whl/cu128:
No packages were checked
Not checked: requirements.txt names an index or source other than PyPI (an --index-url or --extra-index-url line, a [tool.uv] index or sources setting, a Pipfile source), so these may not be PyPI's packages and their names aren't sent to pypi.org: faster-whisper, gradio, gradio-i18n, matplotlib, pyannote.audio, pytubefix, ruamel.yaml, torch, and 2 more. To check them on that index, run uvx wheelgap --index-url with its URL in a checkout.
Two things are wrong for this visitor:
- Nothing here is private.
gradioandmatplotlibonly exist on PyPI, and the other index is a public one that anyone can name. Projects that install PyTorch are among the ones with the most wheel trouble, and this line is how PyTorch's own instructions say to install it. - The advice doesn't work.
--index-url https://download.pytorch.org/whl/cu128makes wheelgap look every package up on that index alone, and it has nogradio.
Where
_private()and_lookups()insite/check/driver.py:return source.kind != "pixi" and not source.pypi_only.- The alert text is built in
site/check/check.mjs("Not checked: ... names an index or source other than PyPI"). - wheelgap sets
pypi_onlyto false for any index option line. It doesn't say which line or which URL, so the driver has to read the option lines of the files it fetched itself.
What to do
- Keep a short list of public extra indexes in
driver.py, starting with one host:download.pytorch.org. Adding a host is a reviewed change, with a comment saying who runs it. - When a requirements file isn't PyPI-only, read its option lines (and those of its fetched includes). If every index option is an
--extra-index-urlwhose host is on the list, and nopyproject.tomloruv.tomlbeside it names an index, the names aren't private: look the packages up on PyPI as for any requirements file. One--index-url,--find-links,--no-index, unlisted host, or line the driver can't read keeps the whole file private, as today. When in doubt, private. - A package the extra index may serve instead of PyPI must not get PyPI's answer as if it were certain. First step: for the PyTorch index, show
torch,torchvisionandtorchaudioasunknown, with the reason "may be installed from download.pytorch.org, which this page doesn't read". Everything else is checked. - Say what happened in an alert:
requirements.txt also installs from download.pytorch.org (--extra-index-url). This page checked PyPI only. - Fix the advice for the files that stay private: with an
--extra-index-url,--index-urlalone isn't the same install. Say to runuvx wheelgap requirements.txtin a checkout, and that it checks PyPI's files.
Done when:
-
tests/test_check_driver.pycovers: the PyTorch line (packages listed for lookup,torchunknown with the reason); the same line plus an--index-url(all private); an--extra-index-urlto another host (all private); a URL with credentials on the listed host (private, and the URL appears nowhere in the result); the option in an included file. -
tests/site/check-page.test.mjsshows the new alert and that the old "run uvx wheelgap --index-url" line is gone for an extra index. -
test_a_private_index_package_is_never_looked_up_on_pypistill passes unchanged. - In the PR:
jhj0517/Whisper-WebUIbefore and after, as screenshots.
Activity
Repo checker: check PyPI's packages when a requirements file only add…