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

pantsbuild / pants / 21552830208

31 Jan 2026 11:40PM UTC coverage: 80.277% (-0.05%) from 80.324%
21552830208

Pull #23062

github

web-flow
Merge 808a9786c into 2c4dcf9cf
Pull Request #23062: Remove support for Get

18 of 25 new or added lines in 4 files covered. (72.0%)

17119 existing lines in 541 files now uncovered.

78278 of 97510 relevant lines covered (80.28%)

3.36 hits per line

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

70.37
/src/python/pants/backend/python/framework/stevedore/rules.py
1
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
1✔
5

UNCOV
6
from collections.abc import Iterable
1✔
7

UNCOV
8
from pants.backend.python.framework.stevedore.python_target_dependencies import (
1✔
9
    find_python_distributions_with_entry_points_in_stevedore_namespaces,
10
)
UNCOV
11
from pants.backend.python.framework.stevedore.target_types import (
1✔
12
    StevedoreNamespacesField,
13
    StevedoreNamespacesProviderTargetsRequest,
14
)
UNCOV
15
from pants.backend.python.goals.pytest_runner import PytestPluginSetup, PytestPluginSetupRequest
1✔
UNCOV
16
from pants.backend.python.target_types import PythonDistribution
1✔
UNCOV
17
from pants.backend.python.util_rules.entry_points import (
1✔
18
    GenerateEntryPointsTxtRequest,
19
    generate_entry_points_txt,
20
)
UNCOV
21
from pants.engine.fs import EMPTY_DIGEST
1✔
UNCOV
22
from pants.engine.rules import Rule, collect_rules, implicitly, rule
1✔
UNCOV
23
from pants.engine.target import Target
1✔
UNCOV
24
from pants.engine.unions import UnionRule
1✔
UNCOV
25
from pants.util.logging import LogLevel
1✔
26

27

UNCOV
28
class GenerateEntryPointsTxtFromStevedoreExtensionRequest(PytestPluginSetupRequest):
1✔
UNCOV
29
    @classmethod
1✔
UNCOV
30
    def is_applicable(cls, target: Target) -> bool:
1✔
31
        # select python_tests targets with stevedore_namespaces field
32
        return (
×
33
            target.has_field(StevedoreNamespacesField)
34
            and target.get(StevedoreNamespacesField).value is not None
35
        )
36

37

UNCOV
38
@rule(
1✔
39
    desc=f"Generate entry_points.txt to imitate `{PythonDistribution.alias}` installation.",
40
    level=LogLevel.DEBUG,
41
)
UNCOV
42
async def generate_entry_points_txt_from_stevedore_extension(
1✔
43
    request: GenerateEntryPointsTxtFromStevedoreExtensionRequest,
44
) -> PytestPluginSetup:
45
    requested_namespaces = request.target[StevedoreNamespacesField]
×
46
    if not requested_namespaces.value:
×
47
        return PytestPluginSetup(EMPTY_DIGEST)
×
48

49
    stevedore_targets = await find_python_distributions_with_entry_points_in_stevedore_namespaces(
×
50
        StevedoreNamespacesProviderTargetsRequest(requested_namespaces), **implicitly()
51
    )
52

53
    requested_namespaces_value = requested_namespaces.value
×
54
    entry_points_txt = await generate_entry_points_txt(
×
55
        GenerateEntryPointsTxtRequest(
56
            stevedore_targets,
57
            lambda tgt, ns: ns in requested_namespaces_value,
58
            lambda tgt, ns, ep_name: True,
59
        )
60
    )
61
    return PytestPluginSetup(entry_points_txt.digest)
×
62

63

UNCOV
64
def rules() -> Iterable[Rule | UnionRule]:
1✔
UNCOV
65
    return (
1✔
66
        *collect_rules(),
67
        UnionRule(
68
            PytestPluginSetupRequest,
69
            GenerateEntryPointsTxtFromStevedoreExtensionRequest,
70
        ),
71
    )
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