Repository navigation
Validate Pipfile markers against the PEP 508 grammar - #820
Conversation
|
Review at head 32aeb20 (main b6eb246 is in it). CHANGES, one blocker. Blocker: Grammar probe: 99 marker strings through
Valid input vs #818: py-only, os-only, two-key, sys_platform, platform_machine, full+shorthand, and OR cases give identical markers. Differences are only for invalid input, as intended (unquoted Long and hostile input otherwise fine: 100k-term Suite: 250/250 pass in packages/adapters/python. Fail-first: with main's pipfile.ts under the PR tests, "drops a Pipfile marker that does not parse, including unquoted shorthand values" fails. CI at review time: not CI-green. CodeFactor, typecheck, lint, self-scan, image and the ubuntu consumer jobs passed; corpus, test (22/24) and windows consumer jobs were still running. Same-account review. |
The leading-operator check let unquoted shorthand values and invalid full markers strings through as invalid marker text. Parse the combined marker and leave the requirement unconditional when it does not parse, as pipenv does.
32aeb20 to
dfcbc19
Compare
|
Re-review at head dfcbc19 (main b6eb246 is in it). PASS with notes. Blocker fixed: depth cap 64. Probed through Notes (minor, not blocking):
Suite: 252/252 pass in packages/adapters/python. CI at review time: not CI-green. CodeFactor passed; typecheck, lint, test 22/24, image, consumer jobs and self-scan were still running. Same-account review. |
Fixes #819.
The operator check from #818 only looked at the start of the value, so
python_version = "< 3.11"andsys_platform = "== win32"(unquoted) and an invalid fullmarkersstring still produced marker text that does not parse. The combined marker is now checked against the PEP 508 marker grammar and dropped when it fails, as pipenv does. Valid markers, including thesys_platformandplatform_machineshorthand, are unchanged. The new Pipfile regression fails before the change; Python adapter suite 249 pass, Prettier and ESLint clean.