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.
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.
Thank you to Klayvio and Normal Computing for their Platinum tier support through throughout this release.
- Support for Python 3.13
pants export --binallows exporting more tools for use outside Pants- A new experimental Python Provider backend using Python Build Standalone.
- A new options system unlocks future changes.
- Python 2.7: As announced in the v2.23.x release series, Pants v2.24 and later are not proactively tested in CI with Python 2.7 since Python 2.7 is no longer supported by its maintainers as of 1 January 2020. While Pants may continue to work with Python 2.7 in the near term, Pants no longer officially supports use of Python 2.7, and, consequently, any remaining support for Python 2.7 may "bit rot" and diverge over time. Contributions to fix issues with Python 2.7 support will continue to be accepted, but will depend on any community contributions and will not constitute continued official support for Python 2.7.
- macOS versions: Pants v2.24 is the last version that will support macOS 12, as macOS 12 is reaching the end of Apple's support. Future versions of Pants will require macOS 14 or newer (on arm64), and macOS 13 or newer (on x86-64). In addition, as announced in the v2.23.x release series, Pants v2.24 is built on macOS 12 and so may not work on versions of macOS 10.15 and 11 (which Apple no longer supports).
- Pants runner: Pants v2.24 is the last version that supports versions of the
pantslauncher binary older than 0.12.2. Pants v2.25 and newer will require 0.12.2. Follow the upgrade instructions.
Fixed bug where pants peek --include-additional-info was not actually displaying the additional info (#21399).
Fixed a BSP server bug where multiple concurrent writes of the same workspace files would contend and cause filesystem errors (#21698).
This release switches the Pants options system to use the new "native" implementation written in Rust first introduced in the 2.22.x series.
To ensure that this transition is not disruptive, this release will run the new system alongside the "legacy" options system, 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.
The "legacy" system will be removed in the 2.25.x series.
Many tools that Pants downloads can now be exported using the new export --bin option. For example, pants export --bin="helm" will export the helm binary to dist/export/bin/helm. For each tool, all the files are exported to a subfolder in dist/export/bins/, and the main executable is linked to dist/export/bin/.
Generating all lockfiles properly deduplicates requests, preventing generating the same lockfile twice for resolves that shadow a tool's builtin resolve name. (#21642)
Fix a bug where Pants raised an internal exception which occurred when compiling a Go package with coverage support when the package also had an external test which imported the base package.
Fix a bug where Pants sent a minor Go version instead of the major one to the Go toolchain during packaging.
Recognize -fullpath as a test binary flag.
Add support for the all: prefix to patterns used with the go:embed directive. The all: prefix includes files which start with _ or . which are ordinarily excluded .
Compression of class files into a jar file is not reading or writing from the remote cache. The size of jar files, combined with the low computational cost of compression, can outweigh the advantages of using a remote cache.
Fixed a Coursier fetch wrapper script bug on NixOS.
Fixed a jvm.sh script bug on NixOS.
The Kotlin linter, ktlint, has been updated to version 1.3.1.
Pants' support for different Python versions has changed:
-
The default lockfiles bundled with Pants for various tools (ex: to run
black) now support Python 3.13. -
breaking change: those lockfiles no longer support Python 3.7. The minimum Python version is now 3.8. Pants still supports running Python 3.7 (and earlier!) user code, but you will need to generate your own lockfiles. See the announcement at https://www.pantsbuild.org/blog/2024/08/24/venerable-pythons for further context.
-
Pants v2.24 and later are not proactively tested in CI with Python 2.7 since Python 2.7 is no longer supported by its maintainers as of 1 January 2020. While Pants may continue to work with Python 2.7 in the near term, Pants no longer officially supports use of Python 2.7, and, consequently, any remaining support for Python 2.7 may "bit rot" and diverge over time. Contributions to fix issues with Python 2.7 support will continue to be accepted, but will depend on any community contributions and will not constitute continued official support for Python 2.7.
Breaking change: the pants.backend.experimental.python.lint.ruff.check and pants.backend.experimental.python.lint.ruff.format subsystems now execute Ruff as a downloaded binary, directly from the Ruff releases, rather than using Pex to execute the PyPI ruff package. This has less overhead, and makes customizing the version simpler. However, options like [ruff].install_from_resolve are now ignored and will be removed in future. If you have customized the version, use [ruff].version and [ruff].known_versions instead. This version of Pants includes built-in known-versions for the latest patch release (at time of development) of each 0.x minor series (0.7.2, 0.6.9, 0.5.7, 0.4.10, 0.3.7, 0.2.2, 0.1.15): if you install from a resolve with a particular pinned version of Ruff, you may find setting [ruff].version to the closest matching version in that list is acceptable (if not, you may need to add to [ruff].known_versions).
Version Updates:
-
As a consequence of the lockfile generation, newer versions of many tools are now included in the default lockfiles.
-
The default version of pip is now 24.2 bringing performance improvements to dependency resolution and support for Python 3.13.
-
The default versions of
setuptoolsandwheelused in Pants have been upgraded to74.1.2and0.44.0to address a remote code execution vulnerability in versions before setuptools70.0. This forces the minimum Python version to 3.8, in line with the changes mentioned above. -
The default version of the Pex tool has been updated from 2.16.2 to 2.20.3.
-
The default version of the Pyright tool has been updated from 1.1.365 to 1.1.383.
-
The default version of the Ruff tool has been updated from 0.4.9 to 0.7.2. (As discussed above, one can pin to particular versions, including 0.4.9, via the new
[ruff].versionand[ruff].known_versionsoptions.)
A new experimental Python Provider using Python Build Standalone is available as pants.backend.python.providers.experimental.python_build_standalone. This joins the existing pyenv provider as a way for Pants to take care of providing an appropriate Python.
Other changes:
-
Mypy will now typecheck previously-ignored python sources without a
.pyor.pyiextension. -
Update default package mapping for
pymupdfto match imports from bothfitz(the legacy name) andpymupdf(the currently supported name. -
The deprecation of
resolve_local_platforms(both a field ofpex_binary, and a option of[pex-binary-defaults]) has expired and thus they have been removed.
Tools that are installed from a user resolve will not present their default resolve for generate-lockfiles and export.
The pants.backend.url_handlers.s3 backend now correctly passes along query parameters such as versionId for s3:// urls.
The default version of the semgrep tool has been upgraded from 1.86.0 to 1.94.0.
Pants will now warn if any errors are encountered while fingerprinting candidate binaries for the system_binary target type. The warnings may be disabled by setting the new log_fingerprinting_errors field on system_binary to False.
Added a new cache_scope field to adhoc_tool and shell_command targets to allow configuration of the "cache scope" of the invoked process. The cache scope determines how long Pants will cache the result of the invoked process absent any other invalidation of the result via source or dependency changes.
The path_metadata_request intrinsic rule can now access metadata for paths in the local system outside of the build root. Use the new namespace field on PathMetadataRequest to request metadata on local system paths using namespace PathNamespace.SYSTEM.
PyO3, the interface crate between Rust and Python, has been upgraded to v0.22.x. A major change is that all Python values on the Rust side must be handled via either the pyo3::Bound or pyo3::Py smart pointers; direct references such as &PyAny are no longer supported.
GenerateToolLockfileSentinel is removed. See the porting guide details for instructions on migrating.
Previously SetupKwargs took _allow_banned_keys which would allow one to pass in certain critical setuptools args (ex: install_requires) that Pants calculates for you. If you Really Really know what you are doing you can know also use _overwrite_banned_keys to exclusively use your own values and ignore the Pants calculated ones.
For the full changelog, see the individual GitHub Releases for this series: https://github.com/pantsbuild/pants/releases