• 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/codegen/protobuf/tailor.py
1
# Copyright 2021 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.codegen.protobuf.protoc import Protoc
×
UNCOV
9
from pants.backend.codegen.protobuf.target_types import ProtobufSourcesGeneratorTarget
×
UNCOV
10
from pants.core.goals.tailor import (
×
11
    AllOwnedSources,
12
    PutativeTarget,
13
    PutativeTargets,
14
    PutativeTargetsRequest,
15
)
UNCOV
16
from pants.engine.intrinsics import path_globs_to_paths
×
UNCOV
17
from pants.engine.rules import collect_rules, rule
×
UNCOV
18
from pants.engine.unions import UnionRule
×
UNCOV
19
from pants.util.dirutil import group_by_dir
×
UNCOV
20
from pants.util.logging import LogLevel
×
21

22

UNCOV
23
@dataclass(frozen=True)
×
UNCOV
24
class PutativeProtobufTargetsRequest(PutativeTargetsRequest):
×
UNCOV
25
    pass
×
26

27

UNCOV
28
@rule(level=LogLevel.DEBUG, desc="Determine candidate Protobuf targets to create")
×
UNCOV
29
async def find_putative_targets(
×
30
    req: PutativeProtobufTargetsRequest, all_owned_sources: AllOwnedSources, protoc: Protoc
31
) -> PutativeTargets:
32
    if not protoc.tailor:
×
33
        return PutativeTargets()
×
34

35
    all_proto_files = await path_globs_to_paths(req.path_globs("*.proto"))
×
36
    unowned_proto_files = set(all_proto_files.files) - set(all_owned_sources)
×
37
    pts = [
×
38
        PutativeTarget.for_target_type(
39
            ProtobufSourcesGeneratorTarget,
40
            path=dirname,
41
            name=None,
42
            triggering_sources=sorted(filenames),
43
        )
44
        for dirname, filenames in group_by_dir(unowned_proto_files).items()
45
    ]
46
    return PutativeTargets(pts)
×
47

48

UNCOV
49
def rules():
×
UNCOV
50
    return [
×
51
        *collect_rules(),
52
        UnionRule(PutativeTargetsRequest, PutativeProtobufTargetsRequest),
53
    ]
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