• 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/k8s/target_types.py
1
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
UNCOV
3
from typing import ClassVar
×
4

UNCOV
5
from pants.engine.target import (
×
6
    COMMON_TARGET_FIELDS,
7
    Dependencies,
8
    MultipleSourcesField,
9
    SingleSourceField,
10
    SpecialCasedDependencies,
11
    StringField,
12
    Target,
13
    TargetFilesGenerator,
14
    generate_multiple_sources_field_help_message,
15
)
UNCOV
16
from pants.util.strutil import help_text
×
17

18

UNCOV
19
class K8sSourceField(SingleSourceField):
×
UNCOV
20
    expected_file_extensions: ClassVar[tuple[str, ...]] = (".yml", ".yaml")
×
21

22

UNCOV
23
class K8sSourcesField(MultipleSourcesField):
×
UNCOV
24
    default = ("*.yaml", "*.yml")
×
UNCOV
25
    expected_file_extensions: ClassVar[tuple[str, ...]] = (".yml", ".yaml")
×
UNCOV
26
    help = generate_multiple_sources_field_help_message(
×
27
        "Example: `sources=['example.yaml', 'new_*.yaml', '!old_ignore.yaml']`"
28
    )
29

30

UNCOV
31
class K8sSourceDependenciesField(Dependencies):
×
UNCOV
32
    pass
×
33

34

UNCOV
35
class K8sSourceTarget(Target):
×
UNCOV
36
    alias = "k8s_source"
×
UNCOV
37
    core_fields = (
×
38
        # Provides `tags`
39
        *COMMON_TARGET_FIELDS,
40
        K8sSourceField,
41
        K8sSourceDependenciesField,
42
    )
UNCOV
43
    help = "A single k8s object spec file."
×
44

45

UNCOV
46
class K8sSourcesTargetGenerator(TargetFilesGenerator):
×
UNCOV
47
    alias = "k8s_sources"
×
UNCOV
48
    generated_target_cls = K8sSourceTarget
×
49

UNCOV
50
    core_fields = (
×
51
        # Provides `tags`
52
        *COMMON_TARGET_FIELDS,
53
        K8sSourcesField,
54
    )
UNCOV
55
    copied_fields = COMMON_TARGET_FIELDS
×
UNCOV
56
    moved_fields = (K8sSourceDependenciesField,)
×
UNCOV
57
    help = help_text(
×
58
        f"""
59
        Generate a `{K8sSourceTarget.alias}` target for each file in the `{K8sSourcesField.alias}` field.
60
        """
61
    )
62

63

UNCOV
64
class K8sBundleSourcesField(SpecialCasedDependencies):
×
UNCOV
65
    alias = "sources"
×
UNCOV
66
    help = "Files to deploy as a bundle"
×
67

68

UNCOV
69
class K8sBundleContextField(StringField):
×
UNCOV
70
    alias = "context"
×
UNCOV
71
    required = True
×
UNCOV
72
    help = "The kubectl context to use for deploy."
×
73

74

UNCOV
75
class K8sBundleDependenciesField(Dependencies):
×
UNCOV
76
    alias = "dependencies"
×
77

78

UNCOV
79
class K8sBundleTarget(Target):
×
UNCOV
80
    alias = "k8s_bundle"
×
UNCOV
81
    help = "A bundle of Kubernetes files."
×
UNCOV
82
    core_fields = (
×
83
        *COMMON_TARGET_FIELDS,
84
        K8sBundleSourcesField,
85
        K8sBundleContextField,
86
        K8sBundleDependenciesField,
87
    )
88

89

UNCOV
90
def target_types():
×
91
    return [
×
92
        K8sSourceTarget,
93
        K8sSourcesTargetGenerator,
94
        K8sBundleTarget,
95
    ]
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