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

pantsbuild / pants / 26342152999

23 May 2026 07:59PM UTC coverage: 91.165% (-1.6%) from 92.792%
26342152999

push

github

web-flow
Run Linux ARM CI on Depot runners (#23363)

RunsOn is deprecating their v2 stack, and rather than migrate
to v3 we should use the resources kindly donated by Depot.

GitHub also now has Linux ARM runners, should we need them.

87305 of 95766 relevant lines covered (91.16%)

3.87 hits per line

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

0.0
/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

4
from __future__ import annotations
×
5

6
from collections.abc import Iterable
×
7

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

27

28
class GenerateEntryPointsTxtFromStevedoreExtensionRequest(PytestPluginSetupRequest):
×
29
    @classmethod
×
30
    def is_applicable(cls, target: Target) -> bool:
×
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

38
@rule(
×
39
    desc=f"Generate entry_points.txt to imitate `{PythonDistribution.alias}` installation.",
40
    level=LogLevel.DEBUG,
41
)
42
async def generate_entry_points_txt_from_stevedore_extension(
×
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

64
def rules() -> Iterable[Rule | UnionRule]:
×
65
    return (
×
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