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)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
- 领域
- build-system
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 0
- 派生
- 1
- 平均合并
- 5 小时 59 分钟
- 30 天内合并 PR
- 19
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wheelgap/wheels 的其他 Issue
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
enhancement help wanted
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
-
bug help wanted
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
ActivityWatch/docs#223 ·
-
[Bug]: OpenCode v2 skips an assistant message that gains text after an earlier capture可能已有人在做 @jianyx1 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
volcengine/OpenViking#8354 ·
维护者通常 1 天内回复
-
comp/tools P2 tool/skills type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#159541 ·
维护者通常 1 天内回复
-
bot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
request-theme
难度 2/5 1-3 小时 新手友好度 62/100
LizardByte/ThemerrDB#10167 · 1 条评论 ·