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

pantsbuild / pants / 24603661231

18 Apr 2026 11:26AM UTC coverage: 75.987% (-16.9%) from 92.924%
24603661231

Pull #23268

github

web-flow
Merge 6a8601ce1 into a92bc34b6
Pull Request #23268: perf: Remove python coroutine/trampoline overhead in awaits for ~22% faster `dependencies` goal

29 of 37 new or added lines in 4 files covered. (78.38%)

11097 existing lines in 400 files now uncovered.

54036 of 71112 relevant lines covered (75.99%)

1.88 hits per line

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

56.0
/src/python/pants/option/options_diff.py
1
# Copyright 2025 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from dataclasses import fields
4✔
5
from enum import Enum
4✔
6
from typing import Any
4✔
7

8
from pants.option.bootstrap_options import DynamicRemoteOptions
4✔
9

10

11
def summarize_options_map_diff(old: dict[str, Any], new: dict[str, Any]) -> str:
4✔
12
    """Compare two options map (as produced by `OptionsFingerprinter.options_map_for_scope`), and
13
    return a one-liner summarizing all differences, e.g.:
14

15
    `key1: 'old' -> "new'; list_key: ['x', 'y'] -> ['x']`
16
    """
17
    diffs = []
1✔
18
    for key in sorted({*old, *new}):
1✔
19
        o = old.get(key)
1✔
20
        n = new.get(key)
1✔
21

22
        if o == n:
1✔
23
            continue
1✔
24

25
        diffs.append(f"{key}: {o!r} -> {n!r}")
1✔
26

27
    return "; ".join(diffs)
1✔
28

29

30
def summarize_dynamic_options_diff(old: DynamicRemoteOptions, new: DynamicRemoteOptions) -> str:
4✔
31
    """Compare two `DynamicRemoteOptions` and return a one-liner summarizing all differences, e.g.:
32

33
    `provider: 'reapi' -> 'experimental-file'; cache_read: False -> True`
34
    """
UNCOV
35
    diffs = []
×
UNCOV
36
    for field in fields(DynamicRemoteOptions):
×
UNCOV
37
        key = field.name
×
UNCOV
38
        o = getattr(old, key)
×
UNCOV
39
        n = getattr(new, key)
×
40

UNCOV
41
        if o == n:
×
UNCOV
42
            continue
×
43

UNCOV
44
        o = o.value if isinstance(o, Enum) else o
×
UNCOV
45
        n = n.value if isinstance(n, Enum) else n
×
46

UNCOV
47
        diffs.append(f"{key}: {o!r} -> {n!r}")
×
48

UNCOV
49
    return "; ".join(diffs)
×
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