Skip to main content
Version: 2.6 (deprecated)

python-protobuf.mypy-plugin


Configuration of the mypy-protobuf type stub generation plugin for the Protobuf Python backend.

Backend: ``

Config section: [python-protobuf.mypy-plugin]

Basic options

mypy_plugin

--[no-]python-protobuf-mypy-plugin-mypy-plugin
PANTS_PYTHON_PROTOBUF_MYPY_PLUGIN_MYPY_PLUGIN
pants.toml
[python-protobuf.mypy-plugin]
mypy_plugin = <bool>
default: False

Use the mypy-protobuf plugin (https://github.com/dropbox/mypy-protobuf) to also generate .pyi type stubs.

runtime_dependencies

--python-protobuf-mypy-plugin-runtime-dependencies="[<target_option>, <target_option>, ...]"
PANTS_PYTHON_PROTOBUF_MYPY_PLUGIN_RUNTIME_DEPENDENCIES
pants.toml
[python-protobuf.mypy-plugin]
runtime_dependencies = [
<target_option>,
<target_option>,
...,
]
default: []

A list of addresses to python_requirement_library targets for the runtime dependencies needed for generated Python code to work. For example, ['3rdparty/python:protobuf', '3rdparty/python:grpcio']. These dependencies will be automatically added to every protobuf_library target

Advanced options

extra_requirements

--python-protobuf-mypy-plugin-extra-requirements="['<str>', '<str>', ...]"
PANTS_PYTHON_PROTOBUF_MYPY_PLUGIN_EXTRA_REQUIREMENTS
pants.toml
[python-protobuf.mypy-plugin]
extra_requirements = [
'<str>',
'<str>',
...,
]
default: []

Any additional requirement strings to use with the tool. This is useful if the tool allows you to install plugins or if you need to constrain a dependency to a certain version.

interpreter_constraints

--python-protobuf-mypy-plugin-interpreter-constraints="['<str>', '<str>', ...]"
PANTS_PYTHON_PROTOBUF_MYPY_PLUGIN_INTERPRETER_CONSTRAINTS
pants.toml
[python-protobuf.mypy-plugin]
interpreter_constraints = [
'<str>',
'<str>',
...,
]
default:
[
  "CPython>=3.6"
]

Python interpreter constraints for this tool.

version

--python-protobuf-mypy-plugin-version=<str>
PANTS_PYTHON_PROTOBUF_MYPY_PLUGIN_VERSION
pants.toml
[python-protobuf.mypy-plugin]
version = <str>
default: mypy-protobuf==2.4

Requirement string for the tool.

Deprecated options

None

None