Pants 2 is a fast, scalable, user-friendly build system for codebases of all sizes. It's currently focused on Python, Go, Java, Scala, Kotlin, Shell, and Docker, with support for other languages and frameworks coming soon.
Individuals and companies can now sponsor Pants financially.
Pants is an open-source project that is not owned or controlled by any one company or organization, and does incur some expenses. These expenses are managed by Pants Build, a non-profit that was established for this purpose. This non-profit's only source of revenue is sponsorship by individuals and companies that use Pants.
We offer formal sponsorship tiers for companies, as well as individual sponsorships via GitHub.
- A new implementation of the options system.
- Source globs are now less strict, using a "match any" conjunction rather than the previous "match all".
- In-workspace execution of processes via
experimental_workspace_environmenttarget type.
This release introduces a major re-implementation of the Pants options system. This is the code responsible for parsing and applying configuration options from command-line flags, environment variables and config files. The existing "legacy" options system was written in Python. The new "native" implementation is written in Rust.
The two systems are expected to be more-or-less functionally identical. We plan to switch to the native system in release 2.23.x, and remove the legacy system in release 2.24.x. However to ensure that this transition is not disruptive, this release and the next one will run both systems and compare their results, issuing a warning if they differ.
If you encounter such discrepancies, and you can't resolve them easily, please reach out to us on Slack or file an issue.
Pants now supports executing processes locally within the repository itself via the new "workspace" environment which is configured by the new experimental_workspace_environment target type. The primary motivation for this feature is to better support integration with third-party build orchestration tools (e.g., Bazel) which may not operate properly when not invoked in the repository (including in some cases signifcant performance penalties).
There is a significant trade-off though: Pants cannot reasonbly guarantee that build processes are reproducible if they run in the workspace environment. Thus, Pants puts that burden on you, the Pants user, to guarantee that any process executed in the workspace environment is reproducible based solely on inputs in the repository. If a process is not reproducible, then unknown side effects may occur.
New option publish_dependencies
for experimental-deploy
goal that allows you to deploy targets without publishing the dependencies.
Non-parametrized values in overrides will now be removed from the target's address parameters. This fixes a bug where a target with parametrized default values would have inconsistent address parameters with its field values.
A new experimental pants.backend.experimental.sql backend was added along with the sqlfluff
linter. See
docs here.
A new experimental pants.backend.experimental.makeself backend was added to support
makeself tool. A new
makeself_archive
target allows you to create self-extractable archives that bundle files, bash
scripts or even pex binaries into a single executable archive! See examples in the
docs.
The default version of the hikaru packages used to parse Kubernetes resources has been upgraded. If you were previously installing hikaru from a custom resolve you should be aware that the upstream packaging strategy for supporting multiple Kubernetes versions has changed.
Added documentation
for jvm_artifacts
targets generator from pom.xml.
Exclusions for jvm_artifact and scala_artifact now correctly handle a jvm_exclude with only the group defined.
Added a deploy_jar_exclude_files option to the [jvm] subsystem, containing file patterns to exclude from all
deploy jars, in addition to those specified on a per-jar basis in the deploy_jar target's exclude_files field.
This option's default value excludes signature files from constituent jars, which are known to cause the deploy jar
to fail to execute (since naturally it doesn't match those signatures).
Scala dependency inference used to ignore self-type annotations, which led to not being able to detect dependencies between files in the same package where self-type annotations were used. Moving forward if self-type annotations are being used and no import present for the given type, it will be assumed the referenced type is defined in the same package.
Also reduced verbosity of log messages for the internal Nailgun server instances used for running or compiling code replacing it by a single message informing about the size of the Nailgun pool. Previous log messages are still emitted at debug log level.
The internal code for exporting JVM tools was refactored.
Setting the orphan_files_behaviour = "ignore" option for pants.backend.experimental.scala.lint.scalafix or pants.backend.experimental.scala.lint.scalafmt backend is now properly silent. It previously showed spurious warnings.
Added an openapi_bundle target that will provide the ability to bundle openapi_document and its openapi_source dependencies into a single file when depended on by other targets. Do note that the openapi_bundle target behaves like a resource target rather than a file target, which in turn will likely affect which mechanism you need to use when loading it in dependent code.
The pants.backend.experimental.python.lint.ruff backend now uses version 0.4.4 by default.
The new layout="loose" field for AWS Lambda function, layer and Google Cloud Function targets outputs the artefact as a directory, rather than a zip file.
Initial support for Python 3.13 (pre-release) has been added. NB. built-in tool like black will not yet run with Python 3.13.
The PyOxizider tool is effectively stagnant. The pants.backend.experimental.python.packaging.pyoxidizer backend docs now have a note reflecting this.
The extra_build_args field is now available on the pex_binaries target generator, in addition to pex_binary.
Default module mappings were added for more modules.
The deprecation for the platforms field for the pex_binary and pex_binaries targets has expired, and so has been removed. The resolve_local_platforms field is now meaningless and is thus deprecated.
Python tool subsystem docs and help text now include the default version of the tool, along with instructions on how to override this version using a custom lockfile. Additionally, the help text for the install_from_resolve option for Python tools now includes this same information.
Python tools can be exported from their default bundled lockfiles. For instance, when using the default black subsystem, pants export --resolve=black will export a venv containing the version of black that Pants runs.
New field pex_build_extra_args is available on FaaS targets python_aws_lambda_function,
python_aws_lambda_layer, and [python_google_cloud_function]((https://www.pantsbuild.org/2.22/reference/targets/python_aws_lambda_layer#pex_build_extra_args). This allows passing arguments to the pex invocation for collecting sources and packaging.
The runtime field of aws_python_lambda_layer or aws_python_lambda_function now has a built-in complete platform configuration for x86-64 Python 3.12. This provides stable support for Python 3.12 lambdas out of the box, allowing deleting manual complete_platforms configuration if any.
pants export of a Python resolve will now include generated Python sources (for example, from protobuf_sources or thrift_sources targets) if the resolve is configured in the new --export-py-generated-sources-in-resolve advanced option.
When using the vcs_version target, force setuptools_scm git operations to run in the local environment, so that the local git state is available to them.
The default version of semgrep used by the pants.backends.experimental.tool.semgrep backend is now version 1.72.0, upgraded from 1.46.0. This version requires Python 3.8 or greater.
The pants.backend.shell.lint.shfmt backend now uses shfmt version 3.8.0 by default.
Setting the orphan_files_behaviour = "ignore" option the pants.backend.experimental.tools.yamllint backend is now properly silent. It previously showed spurious warnings.
Pants now correctly extracts the image ID when passing the equivalent of --provenance=false to docker buildx.
The PythonToolRequirementsBase and PythonToolBase classes now have a new help_short field. Subclasses should now use help_short instead of the help field. The help field will be automatically generated using help_short, and will include the tool's default package version and provide instructions on how to override this version using a custom lockfile.
The process execution intrinsic rule in Rust now contains support for "in workspace" execution. This is local execution from within the repository itself without using an execution sandbox. ProcessExecutionEnvironment's constructor has a new execute_in_workspace parameter which enables workspace execution.
- The results summary at the end are now sorted for the
publishgoal.
For the full changelog, see the individual GitHub Releases for this series: https://github.com/pantsbuild/pants/releases