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

pantsbuild / pants / 18252174847

05 Oct 2025 01:36AM UTC coverage: 43.382% (-36.9%) from 80.261%
18252174847

push

github

web-flow
run tests on mac arm (#22717)

Just doing the minimal to pull forward the x86_64 pattern.

ref #20993

25776 of 59416 relevant lines covered (43.38%)

1.3 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).
3
from __future__ import annotations
×
4

5
from dataclasses import dataclass
×
6

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

11

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

17
    @classmethod
×
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

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

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

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

56
    @property
×
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

© 2026 Coveralls, Inc