Skip to content

pipelines: replace stderr prints with warnings.warn in library functions #31

Closed

Description

@shaypal5

Context

PR #30 moved pipeline functions from scripts/build_v5_snapshot.py into leadforge/pipelines/build_v5.py. These functions (subsample() in particular) print warnings directly to sys.stderr.

Now that they live in the package, downstream callers can't easily suppress or redirect this output. Library code should use warnings.warn() or a logger instead.

What to do

  1. Replace print(..., file=sys.stderr) calls in leadforge/pipelines/build_v5.py with warnings.warn(..., stacklevel=2)
  2. Update tests in tests/scripts/test_build_v5_snapshot.py to use pytest.warns() instead of capsys.readouterr()
  3. Optionally keep the print in the CLI wrapper (scripts/build_v5_snapshot.py) for user-facing progress messages

Origin

Copilot review comment on PR #30.

Activity

  1. added
    type: refactor
    layer: pipelines
    on Apr 30, 2026
  2. added a commit that references this issue on Apr 30, 2026
    4b2f74b
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

    layer: pipelinestype: refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions