Why
parse_requirements_txt currently skips any line starting with -, which means -r base.txt includes are ignored. Projects that split deps across requirements/base.txt + requirements/dev.txt get no pins from the top file.
What to do
- In
sidecar/src/docchat_sidecar/lockfiles.py, when a line is -r <file> or --requirement <file>, resolve the referenced file relative to the current file's directory and recurse into it.
- Guard against cycles (track visited paths). Keep ignoring other
-/-- option lines.
Acceptance criteria
- Tests: a
requirements.txt that -r-includes another file yields the union of pins; a self-referential include does not infinite-loop.
- Full sidecar check pipeline green.
Pointers
parse_requirements_txt and its include-skip branch in lockfiles.py.
Why
parse_requirements_txtcurrently skips any line starting with-, which means-r base.txtincludes are ignored. Projects that split deps acrossrequirements/base.txt+requirements/dev.txtget no pins from the top file.What to do
sidecar/src/docchat_sidecar/lockfiles.py, when a line is-r <file>or--requirement <file>, resolve the referenced file relative to the current file's directory and recurse into it.-/--option lines.Acceptance criteria
requirements.txtthat-r-includes another file yields the union of pins; a self-referential include does not infinite-loop.Pointers
parse_requirements_txtand its include-skip branch inlockfiles.py.