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

pantsbuild / pants / 25443604553

06 May 2026 03:05PM UTC coverage: 92.879% (-0.04%) from 92.915%
25443604553

push

github

web-flow
[pants_ng] Scaffolding for a pants_ng mode. (#23319)

In this mode the command line is parsed as an
NG invocation, and dispatched appropriately.

Of course at the moment there are no
implementations to dispatch to. That will follow.

This does expose a new option, `pants_ng` to users. 
There is a big warning not to set it, but we're not trying
to hide that we're working on a new thing, so I am
comfortable with this.

25 of 76 new or added lines in 9 files covered. (32.89%)

1294 existing lines in 76 files now uncovered.

92234 of 99306 relevant lines covered (92.88%)

4.05 hits per line

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

96.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
1✔
4

UNCOV
5
from dataclasses import dataclass
1✔
6

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

11

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

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

28

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

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

UNCOV
40
    _jvm_plugins = StrListOption(
1✔
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
1✔
UNCOV
57
    def jvm_plugins(self) -> tuple[PluginArtifactSpec, ...]:
1✔
UNCOV
58
        return tuple(PluginArtifactSpec.from_str(pa_str) for pa_str in self._jvm_plugins)
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