Backends
How to enable specific functionality.
Most Pants functionality is opt-in by adding the relevant backend to the [GLOBAL].backend_packages
option in pants.toml
. For example:
pants.toml
[GLOBAL]
backend_packages = [
"pants.backend.shell",
"pants.backend.python",
"pants.backend.python.lint.black",
]
Available backends
Backend | What it does | Docs |
---|---|---|
pants.backend.awslambda.python | Enables generating an AWS Lambda zip file from Python code. | AWS Lambda |
pants.backend.codegen.protobuf.lint.buf | Activate the Buf formatter and linter for Protocol Buffers. | Protobuf |
pants.backend.codegen.protobuf.python | Enables generating Python from Protocol Buffers. Includes gRPC support. | Protobuf and gRPC |
pants.backend.codegen.thrift.apache.python | Enables generating Python from Apache Thrift. | Thrift |
pants.backend.docker | Enables building, running, and publishing Docker images. | Docker overview |
pants.backend.docker.lint.hadolint | Enables Hadolint, a Docker linter: https://github.com/hadolint/hadolint | Docker overview |
pants.backend.experimental.codegen.protobuf.go | Enables generating Go from Protocol Buffers. | |
pants.backend.experimental.go | Enables Go support. | Go overview |
pants.backend.experimental.java | Enables core Java support. | Java & Scala overview |
pants.backend.experimental.java.lint.google_java_format | Enables Google Java Format. | Java & Scala overview |
pants.backend.experimental.scala | Enables core Scala support. | Java & Scala overview |
pants.backend.experimental.scala.lint.scalafmt | Enables the Scalafmt formatter. | Java & Scala overview |
pants.backend.experimental.python.lint.autoflake | Enables Autoflake, which removes unused Python imports: https://pypi.org/project/autoflake/ | Linters and formatters |
pants.backend.experimental.python.lint.pyupgrade | Enables Pyupgrade, which upgrades to new Python syntax: https://pypi.org/project/pyupgrade/ | Linters and formatters |
pants.backend.experimental.python.packaging.pyoxidizer | Enables pyoxidizer_binary target. | PyOxidizer |
pants.backend.google_cloud_function.python | Enables generating a Google Cloud Function from Python code. | Google Cloud Function |
pants.backend.plugin_devoplment | Enables pants_requirements target. | Plugins overview |
pants.backend.python | Core Python support. | Enabling Python support |
pants.backend.python.mixed_interpreter_constraints | Adds the py-constraints goal for insights on Python interpreter constraints. | Interpreter compatibility |
pants.backend.python.lint.bandit | Enables Bandit, the Python security linter: https://bandit.readthedocs.io/en/latest/. | Linters and formatters |
pants.backend.python.lint.black | Enables Black, the Python autoformatter: https://black.readthedocs.io/en/stable/. | Linters and formatters |
pants.backend.python.lint.docformatter | Enables Docformatter, the Python docstring autoformatter: https://github.com/myint/docformatter. | Linters and formatters |
pants.backend.python.lint.flake8 | Enables Flake8, the Python linter: https://flake8.pycqa.org/en/latest/. | Linters and formatters |
pants.backend.python.lint.isort | Enables isort, the Python import autoformatter: https://timothycrosley.github.io/isort/. | Linters and formatters |
pants.backend.python.lint.pylint | Enables Pylint, the Python linter: https://www.pylint.org | Linters and formatters |
pants.backend.python.lint.yapf | Enables Yapf, the Python formatter: https://pypi.org/project/yapf/ | Linters and formatters |
pants.backend.python.typecheck.mypy | Enables MyPy, the Python type checker: https://mypy.readthedocs.io/en/stable/. | check |
pants.backend.shell | Core Shell support, including shUnit2 test runner. | Shell overview |
pants.backend.shell.lint.shfmt | Enables shfmt, a Shell autoformatter: https://github.com/mvdan/sh. | Shell overview |
pants.backend.shell.lint.shellcheck | Enables Shellcheck, a Shell linter: https://www.shellcheck.net/. | Shell overview |