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

pantsbuild / pants / 21465010194

29 Jan 2026 03:55AM UTC coverage: 80.275% (+0.005%) from 80.27%
21465010194

push

github

web-flow
Use Depot hosted runners instead of GHA hosted runners. (#22993)

Depot have kindly offered use of their runners as in-kind sponsorship.

78810 of 98175 relevant lines covered (80.28%)

3.36 hits per line

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

92.11
/src/python/pants/engine/explorer.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
12✔
5

6
from collections.abc import Callable, Iterable
12✔
7
from dataclasses import dataclass
12✔
8
from typing import Any, TypeVar, cast
12✔
9

10
from pants.base.exiter import ExitCode
12✔
11
from pants.build_graph.build_configuration import BuildConfiguration
12✔
12
from pants.engine.environment import EnvironmentName
12✔
13
from pants.engine.internals.scheduler import SchedulerSession
12✔
14
from pants.engine.internals.selectors import Params
12✔
15
from pants.engine.rules import QueryRule
12✔
16
from pants.engine.unions import UnionRule, union
12✔
17
from pants.help.help_info_extracter import AllHelpInfo
12✔
18

19
T = TypeVar("T")
12✔
20

21

22
@union(in_scope_types=[EnvironmentName])
12✔
23
@dataclass(frozen=True)
12✔
24
class ExplorerServerRequest:
12✔
25
    address: str
12✔
26
    port: int
12✔
27
    request_state: RequestState
12✔
28

29
    @classmethod
12✔
30
    def rules_for_implementation(cls, impl: type):
12✔
31
        return (
×
32
            UnionRule(cls, impl),
33
            QueryRule(ExplorerServer, (impl, EnvironmentName)),
34
        )
35

36

37
@dataclass(frozen=True)
12✔
38
class ExplorerServer:
12✔
39
    main: Callable[[], ExitCode]
12✔
40

41
    def run(self) -> ExitCode:
12✔
42
        # Work around a mypy issue with a callable attribute.  Related to
43
        # https://github.com/python/mypy/issues/6910.  What has me bugged out is why we don't see
44
        # this issue with `WorkunitsCallbackFactory.callback_factory` too, for instance.
45
        main = cast("Callable[[], ExitCode]", getattr(self, "main"))
×
46
        return main()
×
47

48

49
@dataclass(frozen=True)
12✔
50
class RequestState:
12✔
51
    all_help_info: AllHelpInfo
12✔
52
    build_configuration: BuildConfiguration
12✔
53
    scheduler_session: SchedulerSession
12✔
54
    env_name: EnvironmentName
12✔
55

56
    def product_request(
12✔
57
        self,
58
        product: type[T],
59
        subjects: Iterable[Any] = (),
60
        poll: bool = False,
61
        timeout: float | None = None,
62
    ) -> T:
63
        result = self.scheduler_session.product_request(
1✔
64
            product,
65
            Params(*subjects, self.env_name),
66
            poll=poll,
67
            timeout=timeout,
68
        )
69
        assert len(result) == 1
1✔
70
        return cast(T, result[0])
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

© 2026 Coveralls, Inc