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

Đang mở
#236 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
32/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
devtools

Hướng nghiên cứu

Start in site/check/driver.py: the PUBLIC_EXTRA_INDEXES entry for download.pytorch.org, _lookups() and check(), where extra_pkg_hosts and origin.known_pypi() decide lookup. Then read renderVerdict() in site/check/check.mjs. Done when tests/test_check_driver.py shows numpy and pillow unknown with the reason, scipy checked with lookup: true, fixes() answering the pyyaml gap, and the #219 private-index tests still passing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug help wanted

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 #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 #219 tests pass unchanged.
  • In the PR: keras-team/keras before and after, as screenshots.
Ngôn ngữ chính
JavaScript
Star
0
Fork
0
Merge trung bình
1 giờ 38 phút
Pull request đã merge (30 ngày)
132

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wheelgap/tracker

Tất cả issue của wheelgap/tracker

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.