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

pantsbuild / pants / 21552830208

31 Jan 2026 11:40PM UTC coverage: 80.277% (-0.05%) from 80.324%
21552830208

Pull #23062

github

web-flow
Merge 808a9786c into 2c4dcf9cf
Pull Request #23062: Remove support for Get

18 of 25 new or added lines in 4 files covered. (72.0%)

17119 existing lines in 541 files now uncovered.

78278 of 97510 relevant lines covered (80.28%)

3.36 hits per line

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

100.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
12✔
5
from enum import Enum
12✔
6
from typing import Any
12✔
7

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

10

11
def summarize_options_map_diff(old: dict[str, Any], new: dict[str, Any]) -> str:
12✔
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
    """
UNCOV
17
    diffs = []
2✔
UNCOV
18
    for key in sorted({*old, *new}):
2✔
UNCOV
19
        o = old.get(key)
2✔
UNCOV
20
        n = new.get(key)
2✔
21

UNCOV
22
        if o == n:
2✔
UNCOV
23
            continue
2✔
24

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

UNCOV
27
    return "; ".join(diffs)
2✔
28

29

30
def summarize_dynamic_options_diff(old: DynamicRemoteOptions, new: DynamicRemoteOptions) -> str:
12✔
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 = []
1✔
UNCOV
36
    for field in fields(DynamicRemoteOptions):
1✔
UNCOV
37
        key = field.name
1✔
UNCOV
38
        o = getattr(old, key)
1✔
UNCOV
39
        n = getattr(new, key)
1✔
40

UNCOV
41
        if o == n:
1✔
UNCOV
42
            continue
1✔
43

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

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

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