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

pantsbuild / pants / 25443604553

06 May 2026 03:05PM UTC coverage: 92.879% (-0.04%) from 92.915%
25443604553

push

github

web-flow
[pants_ng] Scaffolding for a pants_ng mode. (#23319)

In this mode the command line is parsed as an
NG invocation, and dispatched appropriately.

Of course at the moment there are no
implementations to dispatch to. That will follow.

This does expose a new option, `pants_ng` to users. 
There is a big warning not to set it, but we're not trying
to hide that we're working on a new thing, so I am
comfortable with this.

25 of 76 new or added lines in 9 files covered. (32.89%)

1294 existing lines in 76 files now uncovered.

92234 of 99306 relevant lines covered (92.88%)

4.05 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
    """
14
    for i, line in enumerate(content.splitlines(), start=1):
7✔
15
        line, _, _ = line.partition("--")
7✔
16
        line = line.strip().rstrip("\\")
7✔
17
        if not line or line.startswith(("#", "-")):
7✔
UNCOV
18
            continue
1✔
19

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

25
        yield PipRequirement.parse(line, description_of_origin=f"{rel_path} at line {i}")
7✔
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

© 2026 Coveralls, Inc