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

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 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/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
×
5

UNCOV
6
from dataclasses import dataclass
×
7

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

12

UNCOV
13
class StevedoreNamespace(str):
×
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"
×
33

34

35
# This is a lot like a SpecialCasedDependencies field, but it doesn't list targets directly.
UNCOV
36
class StevedoreNamespacesField(StringSequenceField):
×
UNCOV
37
    alias = "stevedore_namespaces"
×
UNCOV
38
    help = help_text(
×
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):
×
UNCOV
66
    pass
×
67

68

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

73

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