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

pantsbuild / pants / 19381742489

15 Nov 2025 12:52AM UTC coverage: 49.706% (-30.6%) from 80.29%
19381742489

Pull #22890

github

web-flow
Merge d961abf79 into 42e1ebd41
Pull Request #22890: Updated all python subsystem constraints to 3.14

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

14659 existing lines in 485 files now uncovered.

31583 of 63540 relevant lines covered (49.71%)

0.79 hits per line

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

0.0
/src/python/pants/backend/docker/goals/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
import os
×
UNCOV
7
from dataclasses import dataclass
×
8

UNCOV
9
from pants.backend.docker.subsystems.docker_options import DockerOptions
×
UNCOV
10
from pants.backend.docker.target_types import DockerImageSourceField, DockerImageTarget
×
UNCOV
11
from pants.core.goals.tailor import (
×
12
    AllOwnedSources,
13
    PutativeTarget,
14
    PutativeTargets,
15
    PutativeTargetsRequest,
16
)
UNCOV
17
from pants.engine.intrinsics import path_globs_to_paths
×
UNCOV
18
from pants.engine.rules import collect_rules, rule
×
UNCOV
19
from pants.engine.unions import UnionRule
×
UNCOV
20
from pants.util.logging import LogLevel
×
21

22

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

27

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

35
    all_dockerfiles = await path_globs_to_paths(req.path_globs("*Dockerfile*"))
×
36
    unowned_dockerfiles = set(all_dockerfiles.files) - set(all_owned_sources)
×
37
    pts = []
×
38
    for dockerfile in sorted(unowned_dockerfiles):
×
39
        dirname, filename = os.path.split(dockerfile)
×
40
        kwargs = {} if filename == DockerImageSourceField.default else {"source": filename}
×
41
        pts.append(
×
42
            PutativeTarget.for_target_type(
43
                DockerImageTarget,
44
                path=dirname,
45
                name="docker",
46
                triggering_sources=[filename],
47
                kwargs=kwargs,
48
            )
49
        )
50
    return PutativeTargets(pts)
×
51

52

UNCOV
53
def rules():
×
UNCOV
54
    return [
×
55
        *collect_rules(),
56
        UnionRule(PutativeTargetsRequest, PutativeDockerTargetsRequest),
57
    ]
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