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

pantsbuild / pants / 20332790708

18 Dec 2025 09:48AM UTC coverage: 64.992% (-15.3%) from 80.295%
20332790708

Pull #22949

github

web-flow
Merge f730a56cd into 407284c67
Pull Request #22949: Add experimental uv resolver for Python lockfiles

54 of 97 new or added lines in 5 files covered. (55.67%)

8270 existing lines in 295 files now uncovered.

48990 of 75379 relevant lines covered (64.99%)

1.81 hits per line

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

0.0
/src/python/pants/backend/jsx/goals/tailor.py
1
# Copyright 2024 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 dataclasses
×
UNCOV
7
from collections.abc import Iterable
×
UNCOV
8
from dataclasses import dataclass
×
9

UNCOV
10
from pants.backend.jsx.target_types import (
×
11
    JSX_FILE_EXTENSIONS,
12
    JSXSourcesGeneratorTarget,
13
    JSXTestsGeneratorSourcesField,
14
    JSXTestsGeneratorTarget,
15
)
UNCOV
16
from pants.core.goals.tailor import (
×
17
    AllOwnedSources,
18
    PutativeTarget,
19
    PutativeTargets,
20
    PutativeTargetsRequest,
21
)
UNCOV
22
from pants.core.util_rules.ownership import get_unowned_files_for_globs
×
UNCOV
23
from pants.core.util_rules.source_files import classify_files_for_sources_and_tests
×
UNCOV
24
from pants.engine.rules import Rule, collect_rules, rule
×
UNCOV
25
from pants.engine.unions import UnionRule
×
UNCOV
26
from pants.util.dirutil import group_by_dir
×
UNCOV
27
from pants.util.logging import LogLevel
×
28

29

UNCOV
30
@dataclass(frozen=True)
×
UNCOV
31
class PutativeJSXTargetsRequest(PutativeTargetsRequest):
×
UNCOV
32
    pass
×
33

34

UNCOV
35
@rule(level=LogLevel.DEBUG, desc="Determine candidate JSX targets to create")
×
UNCOV
36
async def find_putative_jsx_targets(
×
37
    req: PutativeJSXTargetsRequest, all_owned_sources: AllOwnedSources
38
) -> PutativeTargets:
39
    unowned_jsx_files = await get_unowned_files_for_globs(
×
40
        req, all_owned_sources, (f"*{ext}" for ext in JSX_FILE_EXTENSIONS)
41
    )
42
    classified_unowned_js_files = classify_files_for_sources_and_tests(
×
43
        paths=unowned_jsx_files,
44
        test_file_glob=JSXTestsGeneratorSourcesField.default,
45
        sources_generator=JSXSourcesGeneratorTarget,
46
        tests_generator=JSXTestsGeneratorTarget,
47
    )
48

49
    return PutativeTargets(
×
50
        PutativeTarget.for_target_type(
51
            tgt_type, path=dirname, name=name, triggering_sources=sorted(filenames)
52
        )
53
        for tgt_type, paths, name in (dataclasses.astuple(f) for f in classified_unowned_js_files)
54
        for dirname, filenames in group_by_dir(paths).items()
55
    )
56

57

UNCOV
58
def rules() -> Iterable[Rule | UnionRule]:
×
UNCOV
59
    return (
×
60
        *collect_rules(),
61
        UnionRule(PutativeTargetsRequest, PutativeJSXTargetsRequest),
62
    )
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