Skip to content
Pantsbuild
The Target API
Initializing search
pantsbuild/pants
Pantsbuild
pantsbuild/pants
Introduction
Introduction
How does Pants work?
Language support
Resource hub
News room
Sponsoring Pants
Testimonials
Welcome to Pants!
Who uses Pants
Getting Started
Getting Started
Prerequisites
Installing Pants
Initial configuration
Example projects and repositories
Incremental adoption
Manual installation
Getting Help
Getting Help
The Pants Community
The Pants Community
Code of conduct
Meet the Team
Maintainers
Contentious decisions
Service providers
Using Pants
Using Pants
Key Concepts
Key Concepts
Goals
Targets and BUILD files
Options
Backends
Source roots
Command line help
Troubleshooting / common issues
Advanced target selection
Project introspection
Assets and archives
Using Pants in CI
Setting up an IDE
Remote caching & execution
Remote caching & execution
Remote caching
Remote execution
Environments: Cross-Platform or Remote Builds
Generating version tags from Git
Anonymous telemetry
Restricted Internet access
Validating dependencies
Python
Python
Python Overview
Python Overview
Enabling Python support
Third-party dependencies
Lockfiles
Interpreter compatibility
Linters and formatters
Pex files
Building distributions
Goals
Goals
check
fmt
lint
package
repl
run
test
Integrations
Integrations
Protobuf and gRPC
Thrift
AWS Lambda
Google Cloud Functions
PyOxidizer
Jupyter
Go
Go
Integrations
Integrations
Protobuf
Java and Scala
Java and Scala
Java and Scala overview
Kotlin
Shell
Shell
Run shell commands
Docker
Docker
Tagging Docker images
Helm
Helm
Deployments
Kubeconform
Integrating new tools without plugins
Writing Plugins
Writing Plugins
Macros
The Target API
The Target API
Concepts
Creating new fields
Creating new targets
Extending existing targets
The Rules API
The Rules API
Concepts
Goal rules
Options and subsystems
File system
Processes
Installing tools
Rules and the Target API
Union rules (advanced)
Logging and dynamic output
Testing plugins
Tips and debugging
Common plugin tasks
Common plugin tasks
Add a linter
Add a formatter
Add a typechecker
Add codegen
Add a REPL
Run tests
Custom python_artifact() kwargs
Plugin upgrade guide
Releases
Releases
Changelog
Deprecation policy
Upgrade tips
Contributions
Contributions
Development
Development
Setting up Pants
Style guide
Developing Rust
Internal architecture
Debugging and benchmarking
Running Pants from sources
Releases
Releases
Release strategy
Release process
GitHub Actions macOS ARM64 runners
Tutorials
Tutorials
Testing plugins
Create a new goal
Advanced plugin concepts
Reference
Reference
Global Options
Goals
Goals
check
count-loc
dependees
dependencies
dependents
experimental-bsp
experimental-deploy
experimental-explorer
export
export-codegen
filedeps
fix
fmt
generate-lockfiles
generate-snapshots
go-generate
help
help-advanced
help-all
lint
list
package
paths
peek
publish
py-constraints
python-dump-source-analysis
repl
roots
run
tailor
test
update-build-files
version
Subsystems
Subsystems
add-trailing-comma
anonymous-telemetry
apache-thrift
autoflake
bandit
black
buf
build-deprecations-fixer
buildifier
changed
cli
coursier
coverage-py
debug-adapter
debugpy
docformatter
docker
dockerfile-parser
download-terraform
environments-preview
filter
flake8
go-test
gofmt
golang
google-java-format
grpc-python-plugin
hadolint
helm
helm-k8s-parser
helm-post-renderer
helm-unittest
ipython
isort
jarjar
java-infer
javac
junit
jvm
kotlin
kotlin-infer
kotlinc
ktlint
lambdex
mypy
mypy-protobuf
nodejs
nodejs-infer
openapi
pex
pex-binary-defaults
pex-cli
preamble
protobuf-java-grpc
protoc
pydocstyle
pylint
pyoxidizer
pytest
python
python-bootstrap
python-infer
python-native-code
python-protobuf
python-repos
python-thrift
pytype
pyupgrade
regex-lint
scala
scala-infer
scalac
scalafmt
scalapb
scalatest
scc
setup-py-generation
setuptools
setuptools-scm
shell-setup
shell-test
shellcheck
shfmt
shunit2
source
spectral
stats
subprocess-environment
terraform-fmt
terraform-hcl2-parser
terraform-validate
thrift
twine
workunit-logger
yamllint
yapf
Targets
Targets
adhoc_tool
archive
deploy_jar
docker_environment
docker_image
experimental_test_shell_command
experimental_wrap_as_go_package_sources
experimental_wrap_as_java_sources
experimental_wrap_as_kotlin_sources
experimental_wrap_as_python_sources
experimental_wrap_as_resources
experimental_wrap_as_scala_sources
file
files
go_binary
go_mod
go_package
go_third_party_package
helm_artifact
helm_chart
helm_deployment
helm_unittest_test
helm_unittest_tests
java_source
java_sources
junit_test
junit_tests
jvm_artifact
jvm_war
kotlin_junit_test
kotlin_junit_tests
kotlin_source
kotlin_sources
kotlinc_plugin
local_environment
openapi_document
openapi_documents
openapi_source
openapi_sources
pants_requirements
pex_binaries
pex_binary
pipenv_requirements
poetry_requirements
protobuf_source
protobuf_sources
pyoxidizer_binary
python_aws_lambda_function
python_distribution
python_google_cloud_function
python_requirement
python_requirements
python_source
python_sources
python_test
python_test_utils
python_tests
relocated_files
remote_environment
resource
resources
run_shell_command
scala_artifact
scala_junit_test
scala_junit_tests
scala_source
scala_sources
scalac_plugin
scalatest_test
scalatest_tests
shell_command
shell_source
shell_sources
shunit2_test
shunit2_tests
system_binary
target
terraform_deployment
terraform_module
thrift_source
thrift_sources
vcs_version
The Target API
¶
Concepts
Creating new fields
Creating new targets
Extending existing targets