mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4526] [Other] The wheel-lock agreement test re-parses requirements with a regex: an extras pin escapes it, and an OS-conditional pin is unsatisfiable #2040
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2040
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4526
Problem:
tests/terminal/test_packaging_pins.py::WheelLocks::test_the_locks_agree_with_requirements_txtdoes not use the parser that made the locks. It rebuilds the pin list withre.match(r"^([A-Za-z0-9_.-]+)==([^\s;]+)(?:\s*;\s*(.*))?$", …)and then handles markers by name (coloramaandnumpyare special-cased by hand). Two holes follow, and both are the check disagreeing withpackaging/lock_wheels.py, which parses the same lines withpackaging.requirements.Requirement.(a) An extras pin is invisible. The character class has no brackets, so a pin like
psycopg[binary]==3.3.6matches nothing and is never looked for in any lock. Measured:re.match(r"^([A-Za-z0-9_.-]+)==([^\s;]+)(?:\s*;\s*(.*))?$", "psycopg[binary]==3.3.6")returnsNone, while the same line with a plain name (fasteners==0.20) matches. A lock that dropped the package would still pass.(b) Any other OS-conditional pin cannot be satisfied. The loop demands every pinned name in every lock, whatever its marker says, so a pin like
embedded-postgres==18.6.3; sys_platform != "win32"is demanded in the Windows lock too - wherelock_wheels.pycorrectly drops it, so no lock content can make the test green (short of shipping a non-Windows server wheel into the Windows archive). Measured on a tree that adds the two store pins: the test fails on all four locks withAssertionError: None != '18.6.3' : embedded-postgres- 4 of 4 subtests, the only failing test in the file.Environment:
Strata Version: 0.2.7.1 (source checkout at tag v0.2.7.1, commit
46c152a1; the test file is upstream's own, unmodified by this fork)OS: Linux x86-64 - Runtime: Python 3.14 host, pytest run of the single file
Expected: the check agrees with the tool that builds the locks - a pin is required in the locks where its marker applies to that target and is not required where it does not; and a pin with extras is checked like any other pin.
Suggested shape: parse both files with
Requirement(already imported bylock_wheels.py), and per lock evaluate the marker against the environmentlock_wheels.TARGETS[target]["env"]+python_version = PYTHON- the same source the lock was built with, so the test cannot drift from the tool. Skip a pin whose marker is false for that target rather than asserting absence: a lock may still need that package transitively, which is exactly the trap in #4525.Reproduction status: measured on this box - the regex probe above, and the 4-of-4 subtest failures with the fork's two pins present (
embedded-postgresnon-Windows,pixeltable-pgserverWindows-only). Upstream's own requirements carry no OS-conditional pin today besidescolorama(its only other marker,truststore; python_version >= "3.10", applies to all four targets), so both halves are latent for mainline until someone adds one - at which point (b) is a wall and (a) is a silent gap.@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.