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

pantsbuild / pants / 21042790249

15 Jan 2026 06:57PM UTC coverage: 43.263% (-35.4%) from 78.666%
21042790249

Pull #23021

github

web-flow
Merge cc03ad8de into d250c80fe
Pull Request #23021: WIP gh workflow scie pex

23 of 33 new or added lines in 3 files covered. (69.7%)

16147 existing lines in 521 files now uncovered.

26164 of 60477 relevant lines covered (43.26%)

0.87 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