• 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

100.0
/src/python/pants/backend/python/framework/stevedore/target_types.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
2✔
5

UNCOV
6
from dataclasses import dataclass
2✔
7

UNCOV
8
from pants.backend.python.target_types import PythonDistribution
2✔
UNCOV
9
from pants.engine.target import StringSequenceField, Targets
2✔
UNCOV
10
from pants.util.strutil import help_text
2✔
11

12

UNCOV
13
class StevedoreNamespace(str):
2✔
14
    """Tag a namespace in entry_points as a stevedore namespace.
15

16
    This is required for the entry_point to be visible to dep inference
17
    based on the `stevedore_namespaces` field.
18

19
    For example:
20
    ```python
21
    python_distribution(
22
        ...
23
        entry_points={
24
            stevedore_namespace("a.b.c"): {
25
                "plugin_name": "some.entry:point",
26
            },
27
        },
28
    )
29
    ```
30
    """
31

UNCOV
32
    alias = "stevedore_namespace"
2✔
33

34

35
# This is a lot like a SpecialCasedDependencies field, but it doesn't list targets directly.
UNCOV
36
class StevedoreNamespacesField(StringSequenceField):
2✔
UNCOV
37
    alias = "stevedore_namespaces"
2✔
UNCOV
38
    help = help_text(
2✔
39
        f"""
40
        List the stevedore namespaces required by this target.
41

42
        Code for all `entry_points` on `{PythonDistribution.alias}` targets with
43
        these namespaces will be added as dependencies so that they are
44
        available on PYTHONPATH during tests. Note that this is only a subset
45
        of the `{PythonDistribution.alias}`s dependencies, so the `entry_points`
46
        only need to be defined on one `{PythonDistribution.alias}` even if the
47
        test only needs some of the `entry_points` namespaces on it.
48

49
        Plus, an `entry_points.txt` file will be generated in the sandbox so that
50
        each of the `{PythonDistribution.alias}`s appear to be "installed". The
51
        `entry_points.txt` file will only include the namespaces requested on this
52
        field. Without this, stevedore would not be able to look up plugins in
53
        the setuptools `entry_points` metadata.
54

55
        NOTE: Each `{PythonDistribution.alias}` must opt-in to being included in
56
        this repo-wide inference by tagging the namespaces with
57
        `{StevedoreNamespace.alias}("my.stevedore.extension")`.
58

59
        The stevedore namespace format (`my.stevedore.extension`) is similar
60
        to a Python namespace.
61
        """
62
    )
63

64

UNCOV
65
class AllStevedoreExtensionTargets(Targets):
2✔
UNCOV
66
    pass
2✔
67

68

UNCOV
69
@dataclass(frozen=True)
2✔
UNCOV
70
class StevedoreNamespacesProviderTargetsRequest:
2✔
UNCOV
71
    stevedore_namespaces: StevedoreNamespacesField
2✔
72

73

UNCOV
74
class StevedoreExtensionTargets(Targets):
2✔
UNCOV
75
    pass
2✔
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