Install test: a folder with a dot in its name is read as two packages (demo/x.data/y.py becomes demo.x.data.y)
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ó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 72/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
- build-system
Hướng nghiên cứu
Start with wheel_modules() and wheel_names() in scripts/build_lab.py, which both build dotted names by joining path parts before checking them with the dotted regex. The fix is one shared helper that checks each folder name and the file stem as identifiers, and rejects Python keywords. Run the WheelModules tests in tests/test_gap_wheels.py, including test_a_folder_with_a_dot_in_its_name_reads_as_two_packages, which needs rewriting. Done when demo/x.data/y.py yields no dotted name and demo/init.py still yields demo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
wheel_modules() and wheel_names() in scripts/build_lab.py turn a wheel's file paths into dotted module names. They join the path's parts with dots first and check the result afterwards:
dotted = re.compile(r"[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*", re.ASCII)
...
name = ".".join(parts)
if parts and dotted.fullmatch(name) ...
A folder whose own name has a dot in it passes that check, because the joined string looks like a longer dotted name:
demo/x.data/y.py -> "demo.x.data.y" (kept: wrong)
demo/_vendor.old/m.py -> "demo._vendor.old.m" (kept: wrong)
demo/v1.2/compat.py -> dropped, but only because "2" isn't an identifier
demo.x.data.y can't be imported: there is no package demo.x. The install test would try, fail, and hold back a wheel that works, with a reason that points at the wrong thing. #35 pinned this in test_a_folder_with_a_dot_in_its_name_reads_as_two_packages and flagged it.
Where
scripts/build_lab.py: wheel_modules() (both loops) and wheel_names(). Tests: WheelModules in tests/test_gap_wheels.py.
What to do
- Check each path part on its own before joining: every folder name, and the file's stem, must be an identifier (
[A-Za-z_][A-Za-z0-9_]*, ASCII, as now). A path with any part that isn't one is left out, as a non-importable file is today. - Do it in one helper used by both functions.
- A Python keyword as a part (
demo/class/x.py) can't be imported with animportstatement either. Leave those out too (keyword.iskeyword). - Don't widen what's accepted: non-ASCII identifiers stay out, as today.
Done when:
- Tests in
WheelModules:demo/x.data/y.pygives nodemo.x.data.yfrom either helper, anddemo(fromdemo/__init__.py) is still named;- an extension module under a dotted folder (
demo/x.y/_ext.cpython-314-x86_64-linux-gnu.so) is still counted in the number of extension modules if that is today's behaviour, or say in the PR why it changes; demo/class/x.pyis left out;- every existing test passes, except
test_a_folder_with_a_dot_in_its_name_reads_as_two_packages, which is rewritten to pin the new behaviour.
- In the PR, the one-line change that makes the new test fail.
uvx --python 3.14 [email protected]passes, offline.
- Ngôn ngữ chính
- Python
- Star
- 0
- Fork
- 1
- Merge trung bình
- 5 giờ 59 phút
- Pull request đã merge (30 ngày)
- 19
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wheelgap/wheels
-
documentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wheelgap/wheels
Issue tương tự
-
bug game: 0100FF500E34A000 game: 0400FF500E34A001 mac packing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
jxxghp/MoviePilot#7576 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
jbaruch/software-factory#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày