Skip to main content
Version: 2.21

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 stable backends

This list is also available via pants backends --help, which includes any additional plugins in your repository that aren't built-in to Pants itself.

BackendWhat it doesDocs
pants.backend.build_files.fmt.blackEnables autoformatting BUILD files using black.
pants.backend.build_files.fmt.buildifierEnables autoformatting BUILD files using buildifier.
pants.backend.build_files.fmt.ruffEnables autoformatting BUILD files using ruff.
pants.backend.build_files.fmt.yapfEnables autoformatting BUILD files using yapf.
pants.backend.awslambda.pythonEnables generating an AWS Lambda zip file from Python code.AWS Lambda
pants.backend.codegen.protobuf.lint.bufActivate the Buf formatter and linter for Protocol Buffers.Protobuf
pants.backend.codegen.protobuf.pythonEnables generating Python from Protocol Buffers. Includes gRPC support.Protobuf and gRPC
pants.backend.codegen.thrift.apache.pythonEnables generating Python from Apache Thrift.Thrift
pants.backend.dockerEnables building, running, and publishing Docker images.Docker overview
pants.backend.docker.lint.hadolintEnables Hadolint, a Docker linter: https://github.com/hadolint/hadolintDocker overview
pants.backend.google_cloud_function.pythonEnables generating a Google Cloud Function from Python code.Google Cloud Function
pants.backend.plugin_developmentEnables pants_requirements target.Plugins overview
pants.backend.pythonCore Python support.Enabling Python support
pants.backend.python.mixed_interpreter_constraintsAdds the py-constraints goal for insights on Python interpreter constraints.Interpreter compatibility
pants.backend.python.lint.autoflakeEnables Autoflake, which removes unused Python imports: https://pypi.org/project/autoflake/Linters and formatters
pants.backend.python.lint.banditEnables Bandit, the Python security linter: https://bandit.readthedocs.io/en/latest/.Linters and formatters
pants.backend.python.lint.blackEnables Black, the Python autoformatter: https://black.readthedocs.io/en/stable/.Linters and formatters
pants.backend.python.lint.docformatterEnables Docformatter, the Python docstring autoformatter: https://github.com/myint/docformatter.Linters and formatters
pants.backend.python.lint.flake8Enables Flake8, the Python linter: https://flake8.pycqa.org/en/latest/.Linters and formatters
pants.backend.python.lint.isortEnables isort, the Python import autoformatter: https://timothycrosley.github.io/isort/.Linters and formatters
pants.backend.python.lint.pydocstyleEnables pydocstyle, a Python docstring convention checker: https://www.pydocstyle.org/Linters and formatters
pants.backend.python.lint.pylintEnables Pylint, the Python linter: https://www.pylint.orgLinters and formatters
pants.backend.python.lint.pyupgradeEnables Pyupgrade, which upgrades to new Python syntax: https://pypi.org/project/pyupgrade/Linters and formatters
pants.backend.python.lint.yapfEnables Yapf, the Python formatter: https://pypi.org/project/yapf/Linters and formatters
pants.backend.python.typecheck.mypyEnables MyPy, the Python type checker: https://mypy.readthedocs.io/en/stable/.typecheck
pants.backend.shellCore Shell support, including shUnit2 test runner.Shell overview
pants.backend.shell.lint.shfmtEnables shfmt, a Shell autoformatter: https://github.com/mvdan/sh.Shell overview
pants.backend.shell.lint.shellcheckEnables Shellcheck, a Shell linter: https://www.shellcheck.net/.Shell overview
pants.backend.tools.preambleEnables "preamble", a Pants fixer for copyright headers and shebang linespreamble
pants.backend.tools.taploEnables Taplo, a TOML autoformatter: https://taplo.tamasfe.dev
pants.backend.url_handlers.s3Enables accessing s3 via credentials in file(source=http_source(...))

Available experimental backends

Pants offers additional backends as previews that are still in development. These backends may still undergo major changes to improve the interface or fix bugs, with fewer (or no) deprecation warnings. If any of these backends are relevant to you, please try them, ask any questions you have, and contribute improvements! Volunteers like you jumping in to help is how these backends are promoted from preview to fully stable.

The list of all backends (both stable and experimental) is also available via pants backends --help-advanced, which includes any additional plugins in your repository that aren't built-in to Pants itself.

BackendWhat it doesDocs
pants.backend.experimental.adhocEnables support for executing arbitrary runnable targets.Integrating new tools without plugins
pants.backend.experimental.ccEnables core C and C++ support.
pants.backend.experimental.cc.lint.clangformatEnables clang-format, a C and C++ autoformatter: https://clang.llvm.org/docs/ClangFormat.html
pants.backend.experimental.codegen.avro.javaEnables generating Java from Avro
pants.backend.experimental.codegen.protobuf.goEnables generating Go from Protocol Buffers.
pants.backend.experimental.codegen.protobuf.javaEnables generating Java from Protocol Buffers.
pants.backend.experimental.codegen.protobuf.scalaEnables generating Scala from Protocol Buffers.
pants.backend.experimental.codegen.thrift.apache.javaEnables generating Java from Thrift using the Apache Thrift generator.
pants.backend.experimental.codegen.thrift.scrooge.javaEnables generating Java from Thrift using the Scrooge Thrift IDL compiler.
pants.backend.experimental.codegen.thrift.scrooge.scalaEnables generating Scala from Thrift using the Scrooge Thrift IDL compiler.
pants.backend.experimental.cueEnables core Cue support: https://cuelang.org/
pants.backend.experimental.debianEnables support for packaging .deb files via dpkg-deb
pants.backend.experimental.goEnables core Go support.Go overview
pants.backend.experimental.go.debug_goalsEnables additional goals for introspecting Go targetsGo overview
pants.backend.experimental.go.lint.golangci_lintEnable golangci-lint, a Go linter: https://golangci-lint.runGo overview
pants.backend.experimental.go.lint.vetEnables support for running go vetGo overview
pants.backend.experimental.helmEnables core Helm support: https://helm.shHelm overview
pants.backend.experimental.helm.check.kubeconfirmEnables Kubeconform, a fast Kubernetes manifest validator: https://github.com/yannh/kubeconformHelm overview
pants.backend.experimental.javaEnables core Java support.Java & Scala overview
pants.backend.experimental.java.debug_goalsEnable additional goals for introspecting Java targetsJava & Scala overview
pants.backend.experimental.java.lint.google_java_formatEnables Google Java Format.Java & Scala overview
pants.backend.experimental.javascriptEnables core JavaScript support.
pants.backend.experimental.javascript.lint.prettierEnables Prettier, a JavaScript (and more) autoformatter: https://prettier.io
pants.backend.experimental.kotlinEnables core Kotlin supportKotlin
pants.backend.experimental.kotlin.debug_goalsEnables additional goals for introspecting Kotlin targetsKotlin
pants.backend.experimental.kotlin.lint.ktlintEnables ktlint, an anti-bikeshedding linter with built-in formatter: https://pinterest.github.io/ktlint/Kotlin
pants.backend.experimental.openapiEnables core OpenAPI support: https://swagger.io/specification/openapi
pants.backend.experimental.openapi.codegen.javaEnables generating Java from OpenAPI
pants.backend.experimental.openapi.lint.openapi_formatEnables openapi-format: https://github.com/thim81/openapi-format
pants.backend.experimental.openapi.lint.spectralEnables spectral: https://github.com/stoplightio/spectralspectral
pants.backend.experimental.pythonEnables experimental rules for Python
pants.backend.experimental.python.framework.djangoEnables better support for projects using Django: https://www.djangoproject.com
pants.backend.experimental.python.framework.stevedoreEnables better support for projects using stevedore: https://docs.openstack.org/stevedore/
pants.backend.experimental.python.lint.add_trailing_commaEnables add-trailing-comma, a Python code formatter: https://github.com/asottile/add-trailing-commaadd-trailing-comma
pants.backend.experimental.python.lint.ruff.checkEnables Ruff (for lint), an extremely fast Python linter: https://docs.astral.sh/ruff/linter/Linters and formatters
pants.backend.experimental.python.lint.ruff.formatEnables Ruff (for fmt), an extremely fast Python code formatter: https://docs.astral.sh/ruff/formatter/Linters and formatters
pants.backend.experimental.python.packaging.pyoxidizerEnables pyoxidizer_binary target.PyOxidizer
pants.backend.experimental.python.typecheck.pyrightEnables Pyright, a Python type checker: https://github.com/microsoft/pyright
pants.backend.experimental.python.typecheck.pytypeEnables Pytype, a Python type checker: https://google.github.io/pytype/
pants.backend.experimental.rustEnables core Rust support.
pants.backend.experimental.scalaEnables core Scala support.Java & Scala overview
pants.backend.experimental.scala.debug_goalsEnables additional goals for introspecting Scala targetsJava & Scala overview
pants.backend.experimental.scala.lint.scalafmtEnables the Scalafmt formatter.Java & Scala overview
pants.backend.experimental.swiftEnables core Swift support.
pants.backend.experimental.terraformEnables core Terraform support.
pants.backend.experimental.terraform.lint.tfsecEnables tfsec, for static analysis of Terraform: https://aquasecurity.github.io/tfsec/
pants.backend.experimental.tools.semgrepEnables semgrep, a fast multi-language static analysis engine: https://semgrep.devsemgrep
pants.backend.experimental.tools.workunit_loggerEnables the workunit logger for debugging pants itselfworkunit-logger
pants.backend.experimental.tools.yamllintEnables yamllint, a linter for YAML files: https://yamllint.readthedocs.io/yamllint
pants.backend.experimental.visibilityEnables __dependencies_rules__ and __dependents_rules__Visibility
pants.backend.python.providers.experimental.pyenvEnables Pants to manage appropriate Python interpreters via pyenv
pants.backend.python.providers.experimental.pyenv.custom_installEnables customising how the pyenv provider builds a Python interpreter