Tests for grafted_library_problem, the check that a recipe's library was linked statically
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- testing-qa
Research direction
Start with grafted_library_problem() in scripts/gap_wheels.py, which flags any member whose top-level folder ends in .libs, and with the existing bundled_licence_problem tests in tests/test_gap_wheels.py to copy their in-memory zipfile style. Add the listed cases: no .libs folder gives None, a top-level .libs folder gives the reason, a top-level notes.libs file and a nested yaml/vendor.libs folder give None, non-zip bytes give the couldn't-read reason, and an empty zip gives None. Run uvx --python 3.14 [email protected] to confirm they pass on main, then apply and revert one-line mutations to show two tests fail.
Written by the indexing model from the issue text.
Description
grafted_library_problem() in scripts/gap_wheels.py (added with library recipes, #33) is one of the checks between a built wheel and publication. A recipe's library must be linked into the extension statically. If the build instead picked up a shared copy from somewhere else, auditwheel bundles it into a <dist>.libs/ folder, and that copy didn't come from the recipe's checked source. The function reads the wheel's member names and returns a reason when it finds such a folder:
grafted = any("/" in n and n.partition("/")[0].endswith(".libs") for n in z.namelist())
...
return "bundles a shared library in a .libs folder; a recipe's library must be linked in statically" if grafted else None
cmd_stage() calls it for every wheel built with a recipe: reason = bundled_licence_problem(data, recipes) or grafted_library_problem(data).
Nothing tests it. git grep grafted_library_problem finds the definition and that one call. A slip in a later edit (say endswith(".libs") becoming == ".libs") would let a wheel with an unreviewed shared library through staging with every test green.
What to do
Add tests to tests/test_gap_wheels.py, next to the tests for bundled_licence_problem. Build each wheel in memory with zipfile (empty files are enough; other tests there show how):
- a wheel with no
.libsfolder:None; PyYAML.libs/libyaml-0.so.2: the reason;pyyaml.libs/x.soandpkg_name.libs/sub/y.so.1: the reason (any top-level folder ending in.libs);- a top-level file named
notes.libs(no/):None; - a nested folder
yaml/vendor.libs/x.so:None, since only a top-level folder is where auditwheel grafts (pin today's behaviour, and say in the PR if you think it's wrong); - bytes that aren't a zip: the reason
couldn't read its members, not an exception; - an empty zip:
None.
And one test through cmd_stage()'s path if the existing staging tests make that easy (tests/test_build_tool_lock.py patches take_wheel for one): a recipe wheel with a .libs folder isn't staged, and its summary line carries the reason.
Tests only: scripts/ stays as it is. If a case shows a real bug, report it in the PR and leave the fix to a maintainer.
Done when:
- The cases above are in
tests/test_gap_wheels.pyand pass onmain. - In the PR description, give two one-line changes to
grafted_library_problem()that each make a test fail (each applied, run and reverted). uvx --python 3.14 [email protected]passes, offline. No new dependencies.
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 5h 42m
- Merged PRs (30d)
- 20
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wheelgap/wheels
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
bug help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
enhancement help wanted
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
Similar issues
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
docling-project/docling-core#1067 ·
Maintainers usually reply within 3 days
-
correction metadata
Difficulty 1/5 Under an hour Newbie friendliness 85/100
acl-org/acl-anthology#11101 · 1 comment ·
Maintainers usually reply within 1 day
-
[BUG] crewai tool create/install/login exit 0 when they failPossibly taken @Kiko0301 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vllm-project/compressed-tensors#1033 ·
Maintainers usually reply within 3 days
-
chore kaizen ui-rewrite
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
IBM/mcp-context-forge#7681 ·
Maintainers usually reply within 2 days