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

pantsbuild / pants / 18827312341

27 Oct 2025 01:50AM UTC coverage: 65.106% (-15.2%) from 80.279%
18827312341

Pull #22806

github

web-flow
Merge 082bdd4c2 into 170094e99
Pull Request #22806: Updated Javascript dependencies and re-locked

3 of 3 new or added lines in 3 files covered. (100.0%)

8118 existing lines in 291 files now uncovered.

48695 of 74793 relevant lines covered (65.11%)

1.81 hits per line

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

0.0
/src/python/pants/backend/codegen/thrift/apache/subsystem.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
UNCOV
3
from __future__ import annotations
×
4

UNCOV
5
import os
×
6

UNCOV
7
from pants.engine.env_vars import EnvironmentVars
×
UNCOV
8
from pants.option.option_types import StrListOption, StrOption
×
UNCOV
9
from pants.option.subsystem import Subsystem
×
UNCOV
10
from pants.util.ordered_set import OrderedSet
×
UNCOV
11
from pants.util.strutil import softwrap
×
12

13

UNCOV
14
class ApacheThriftSubsystem(Subsystem):
×
UNCOV
15
    options_scope = "apache-thrift"
×
UNCOV
16
    help = "Apache Thrift IDL compiler (https://thrift.apache.org/)."
×
17

UNCOV
18
    expected_version = StrOption(
×
19
        default="0.15",
20
        help=softwrap(
21
            """
22
            The major/minor version of Apache Thrift that  you are using, such as `0.15`.
23

24
            Pants will only use Thrift binaries from `--thrift-search-paths` that have the
25
            expected version, and it will error if none are found.
26

27
            Do not include the patch version.
28
            """
29
        ),
30
    )
31

UNCOV
32
    class EnvironmentAware:
×
UNCOV
33
        _thrift_search_paths = StrListOption(
×
34
            default=["<PATH>"],
35
            help=softwrap(
36
                """
37
                A list of paths to search for Thrift.
38

39
                Specify absolute paths to directories with the `thrift` binary, e.g. `/usr/bin`.
40
                Earlier entries will be searched first.
41

42
                The special string `"<PATH>"` will expand to the contents of the PATH env var.
43
                """
44
            ),
45
        )
46

UNCOV
47
        def thrift_search_paths(self, env: EnvironmentVars) -> tuple[str, ...]:
×
48
            def iter_path_entries():
×
49
                for entry in self._thrift_search_paths:
×
50
                    if entry == "<PATH>":
×
51
                        path = env.get("PATH")
×
52
                        if path:
×
53
                            yield from path.split(os.pathsep)
×
54
                    else:
55
                        yield entry
×
56

57
            return tuple(OrderedSet(iter_path_entries()))
×
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