• 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/codegen/protobuf/scala/subsystem.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
UNCOV
3
from __future__ import annotations
×
4

UNCOV
5
from dataclasses import dataclass
×
6

UNCOV
7
from pants.jvm.resolve.jvm_tool import JvmToolBase
×
UNCOV
8
from pants.option.option_types import StrListOption
×
UNCOV
9
from pants.util.strutil import softwrap
×
10

11

UNCOV
12
@dataclass(frozen=True)
×
UNCOV
13
class PluginArtifactSpec:
×
UNCOV
14
    name: str
×
UNCOV
15
    artifact: str
×
16

UNCOV
17
    @classmethod
×
UNCOV
18
    def from_str(cls, s):
×
19
        name, _, artifact = s.partition("=")
×
20
        if name == "" or artifact == "":
×
21
            # TODO: Improve error message.
22
            raise ValueError(f"Plugin artifact `{s}` could not be parsed.")
×
23
        return cls(
×
24
            name=name,
25
            artifact=artifact,
26
        )
27

28

UNCOV
29
class ScalaPBSubsystem(JvmToolBase):
×
UNCOV
30
    options_scope = "scalapb"
×
UNCOV
31
    help = "The ScalaPB protocol buffer compiler (https://scalapb.github.io/)."
×
32

UNCOV
33
    default_version = "0.11.6"
×
UNCOV
34
    default_artifacts = ("com.thesamet.scalapb:scalapbc_2.13:{version}",)
×
UNCOV
35
    default_lockfile_resource = (
×
36
        "pants.backend.codegen.protobuf.scala",
37
        "scalapbc.default.lockfile.txt",
38
    )
39

UNCOV
40
    _jvm_plugins = StrListOption(
×
41
        help=softwrap(
42
            """
43
            A list of JVM-based `protoc` plugins to invoke when generating Scala code from protobuf files.
44
            The format for each plugin specifier is `NAME=ARTIFACT` where NAME is the name of the
45
            plugin and ARTIFACT is either the address of a `jvm_artifact` target or the colon-separated
46
            Maven coordinate for the plugin's jar artifact.
47

48
            For example, to invoke the fs2-grpc protoc plugin, the following option would work:
49
            `--scalapb-jvm-plugins=fs2=org.typelevel:fs2-grpc-codegen_2.12:2.3.1`.
50
            (Note: you would also need to set `--scalapb-runtime-dependencies` appropriately
51
            to include the applicable runtime libraries for your chosen protoc plugins.)
52
            """
53
        ),
54
    )
55

UNCOV
56
    @property
×
UNCOV
57
    def jvm_plugins(self) -> tuple[PluginArtifactSpec, ...]:
×
58
        return tuple(PluginArtifactSpec.from_str(pa_str) for pa_str in self._jvm_plugins)
×
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

© 2025 Coveralls, Inc