• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 18812500213

26 Oct 2025 03:42AM UTC coverage: 80.284% (+0.005%) from 80.279%
18812500213

Pull #22804

github

web-flow
Merge 2a56fdb46 into 4834308dc
Pull Request #22804: test_shell_command: use correct default cache scope for a test's environment

29 of 31 new or added lines in 2 files covered. (93.55%)

1314 existing lines in 64 files now uncovered.

77900 of 97030 relevant lines covered (80.28%)

3.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/python/pants/util/requirements.py
1
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from collections.abc import Iterator
12✔
4

5
from pants.util.pip_requirement import PipRequirement
12✔
6

7

8
def parse_requirements_file(content: str, *, rel_path: str) -> Iterator[PipRequirement]:
12✔
9
    """Parse all `PipRequirement` objects from a requirements.txt-style file.
10

11
    This will safely ignore any options starting with `--` and will ignore comments. Any pip-style
12
    VCS requirements will fail, with a helpful error message describing how to use PEP 440.
13
    """
UNCOV
14
    for i, line in enumerate(content.splitlines(), start=1):
1✔
UNCOV
15
        line, _, _ = line.partition("--")
1✔
UNCOV
16
        line = line.strip().rstrip("\\")
1✔
UNCOV
17
        if not line or line.startswith(("#", "-")):
1✔
UNCOV
18
            continue
1✔
19

20
        # Strip comments which are otherwise on a valid requirement line.
UNCOV
21
        comment_pos = line.find("#")
1✔
UNCOV
22
        if comment_pos != -1:
1✔
UNCOV
23
            line = line[0:comment_pos].strip()
1✔
24

UNCOV
25
        yield PipRequirement.parse(line, description_of_origin=f"{rel_path} at line {i}")
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc