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

pantsbuild / pants / 22285099215

22 Feb 2026 08:52PM UTC coverage: 75.854% (-17.1%) from 92.936%
22285099215

Pull #23121

github

web-flow
Merge c7299df9c into ba8359840
Pull Request #23121: fix issue with optional fields in dependency validator

28 of 29 new or added lines in 2 files covered. (96.55%)

11174 existing lines in 400 files now uncovered.

53694 of 70786 relevant lines covered (75.85%)

1.88 hits per line

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

79.17
/src/python/pants/bsp/spec/resources.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from __future__ import annotations
1✔
4

5
from dataclasses import dataclass
1✔
6
from typing import Any
1✔
7

8
from pants.bsp.spec.base import BuildTargetIdentifier, Uri
1✔
9

10
# -----------------------------------------------------------------------------------------------
11
# Resources Request
12
# See https://build-server-protocol.github.io/docs/specification.html#resources-request
13
# -----------------------------------------------------------------------------------------------
14

15

16
@dataclass(frozen=True)
1✔
17
class ResourcesParams:
1✔
18
    targets: tuple[BuildTargetIdentifier, ...]
1✔
19

20
    @classmethod
1✔
21
    def from_json_dict(cls, d: dict[str, Any]) -> Any:
1✔
UNCOV
22
        return cls(
×
23
            targets=tuple(BuildTargetIdentifier.from_json_dict(x) for x in d["targets"]),
24
        )
25

26
    def to_json_dict(self) -> dict[str, Any]:
1✔
UNCOV
27
        return {"targets": [tgt.to_json_dict() for tgt in self.targets]}
×
28

29

30
@dataclass(frozen=True)
1✔
31
class ResourcesItem:
1✔
32
    target: BuildTargetIdentifier
1✔
33
    # List of resource files.
34
    resources: tuple[Uri, ...]
1✔
35

36
    def to_json_dict(self):
1✔
UNCOV
37
        result = {
×
38
            "target": self.target.to_json_dict(),
39
            "resources": self.resources,
40
        }
UNCOV
41
        return result
×
42

43

44
@dataclass(frozen=True)
1✔
45
class ResourcesResult:
1✔
46
    items: tuple[ResourcesItem, ...]
1✔
47

48
    def to_json_dict(self) -> dict[str, Any]:
1✔
UNCOV
49
        return {
×
50
            "items": [ri.to_json_dict() for ri in self.items],
51
        }
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