Skip to content

Follow -r / --requirement includes in the requirements.txt parser #9

Description

@AshwinUgale

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions