Skip to content

Latest commit

 

History

History
192 lines (125 loc) · 15.1 KB

File metadata and controls

192 lines (125 loc) · 15.1 KB

2.26.x Release Series

Pants is a fast, scalable, user-friendly build system for codebases of all sizes.

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 Klaviyo and Normal Computing for their Platinum tier support through throughout this release.

What's New

Highlights

  • New Kubernetes backend
  • Upgrades of the default versions for many tools
  • Publishing Docker images non-interactively and in parallel
  • Much faster Ruff invocations on macOS

General

Fixed a bug where exponential backoff of file downloads could wait up to 18 days between retries under the default settings. The [GLOBAL].file_downloads_retry_delay option is now used as a multiplier (previously it was the exponential base), and so any customisation of this option may need reconsideration for the new behaviour.

Fixed handling of non-absolute paths in PATH (see #21954 for more info).

New call-by-name syntax for @rules

Pants has a new mechanism for @rule invocation in backends. In this release the following backends were migrated to use this new mechanism. There should not be any user-visible effects, but please be on the lookout for any unusual bugs or error messages.

Tool upgrades

The default versions of various external tools have been upgraded. The previous default versions are still supported, by pinning using the version = "..." field within the subsystem in pants.toml.

Subsystem Backend Old version New version
buildifier pants.backend.build_files.fmt.buildifier "7.1.2" "8.0.3"
golangci-lint pants.backend.experimental.go.lint.golangci_lint "1.51.1" "1.64.6"
helm-unittest pants.backend.experimental.helm "0.3.3" "0.8.0"
kubeconform pants.backend.experimental.helm.check.kubeconfirm "0.6.2" "0.6.7"
nfpm pants.backend.experimental.nfpm "2.38.0" "2.41.3"
pex-cli pants.backend.python "2.33.1" "2.33.4"
pyenv pants.backend.python.providers.experimental.pyenv "2.4.7" "2.5.3"
ruff pants.backend.experimental.python.lint.ruff.check "0.9.6" "0.11.0"
ruff pants.backend.experimental.python.lint.ruff.format "0.9.6" "0.11.0"
taplo pants.backend.tools.taplo "0.8.0" "0.9.3"

Other tools have also been upgraded, and can be pinned using backend-specific methods (such as overriding the lockfile used):

Subsystem Backend Old version New version
nodejs (npm) pants.backend.experimental.javascript 10.8.2 10.9.2
nodejs (pnpm) pants.backend.experimental.javascript 9.5.0 9.15.6
prettier pants.backend.experimental.javascript.lint.prettier 2.6.2 3.5.2
pytype pants.backend.experimental.python.typecheck.pytype 2023.6.16 2024.9.13
pyright pants.backend.experimental.python.typecheck.pyright 1.1.383 1.1.396

Remote caching/execution

When using an REAPI cache, any FindMissingBlobsRequests will now make multiple request if the number of files is large.

Backends

NEW: Kubernetes

Pants now has a pants.backend.experimental.k8s backend to manipulate and deploy kubernetes templates. The new docs have more details.

The new pants.backend.experimental.codegen.python_format_string and pants.backend.experimental.codegen.python_format_string.k8s backends are also helpful, and documented along with the kubernetes backends.

Docker

Added the ability to push docker images non-interactively. This, in turn, allows us to push docker images in parallel within one pants publish invocation. To enable this option, add the following to your pants.toml

[docker]
publish_noninteractively = true

Fixed a bug on package to correctly handle base images referenced by digest only.

Go

Fixed handling local-path replace lines in go.mod (see #14996 for more info).

Javascript

The Node.js runtime was upgraded from version 22.6.0 to version 22.14.0.

The default [nodejs].package_mangers were upgraded to their latest, non-breaking, versions:

  • npm: 10.8.2 → 10.9.2
  • pnpm: 9.5.0 → 9.15.6
  • yarn: 1.22.22 (not upgraded)

The default version of Prettier was upgraded from 2.6.2 to 3.5.2.

Fixed a bug several bugs:

  • Dependency inference now correctly handles imports with file suffixes (e.g., .generated.js).
  • Typescript source files (.ts and .tsx) are now added to the sandbox during JavaScript test execution.
  • The npm_distribution target type is now properly published. It can be used to create publishable npm registry distributions.
TypeScript

Dependency inference now correctly handles imports with file suffixes (e.g., .generated.ts).

Python

The Ruff backends (pants.backend.experimental.python.lint.ruff.check, pants.backend.experimental.python.lint.ruff.format) have had several improvements:

  • Far less overhead for concurrent executions on macOS: the executable is now hard-linked into sandboxes, which side-steps Gatekeeper checks on macOS (when enabled, as they are by default) that made concurrent executions behave as if they were run sequentially.
  • The default version of the Ruff tool has been updated from 0.7.2 to 0.11.0.

Several tools other tools have had their default versions updated too:

  • Pex has been updated from 2.32.0 to 2.33.2. Among many improvements and bug fixes, this unlocks support for pip 25.0.1.
  • Pytype has been updated from version 2023.6.16 to 2024.9.13. This is the last version that supports Python 3.8 and Python 3.9.
  • Pyright has been updated from version 1.1.383 to 1.1.396.

The Python backend now uses the PyPI packaging distribution to parse all Python version numbers and requirements instead of the deprecated pkg_resources distribution. In upgrading packaging from v21.3 to v24.2 and in removing uses of pkg_resources, several user-visible changes occurred:

  • There is no more support for parsing "legacy" Python versions. We do not anticipate an issue here (since PEP 440 has been around since 2013), but please contact the maintainers if an issue does arise.
  • Requirements containing a version with a trailing .* pattern are only valid when used with the == or !+ operators; for example, ==3.9.* or !=3.10.*. Pants previously accepted such requirements when used with the other operators (e.g., <=, <, >, or >=) because pkg_resources accepted that syntax. The current version specifiers specification does not allow that syntax and thus packaging's requirements parser does not either.

The Python Build Standalone backend (pants.backend.python.providers.experimental.python_build_standalone) has release metadata current through PBS release 20250311.

The Rust-based dependency inference logic now handles concatenated string literals properly and so imports such as __import__("foo" ".bar") will infer a dependency on foo.bar.

The pip download log from pex is now materialized into the sandbox when generating lockfiles. For example: pants --keep-sandboxes=always generate-lockfiles --resolve=foo will create a sandbox in /tmp/.../pants-sandbox-.../ with a file named pex-pip-download.log.

Mypy cache is no longer shared between resolves to address shared cache false positives. New cache location is found in ${named_caches_dir}/mypy_cache/<build_root_hash>/<resolve_name>/<py_version>/cache.db.

The pants.backend.experimental.python.framework.django Django backend now allows a repo to have no Django apps without error.

The pex_binary.complete_platforms field can now accept a codegened source, such as the result of an shell_command.

Some deprecations have expired and been removed:

S3

The S3 backend now creates new AWS credentials when the AWS_ environment variables change. This allows credentials to be updated without restarting the Pants daemon.

Shell

The experimental_test_shell_command target type is no longer experimental and is stabilized as the test_shell_command target type. As part of stablilizing it, test_shell_command learned several new features:

  • It now supports the test goal's --debug flag to execute tests interactively.
  • Outputs may now be captured as test "extra outputs" as specified by the new output_files, output_directories, root_output_directory, and outputs_match_mode fields. (These fields operate in the same manner as for the shell_command target type.) Captured output will be written in a directory under dist/ based on the target name when a test completes.
  • It now supports the runnable_dependencies field already supported by the shell_command target type.

Terraform

For the tfsec linter, the deprecation of support for leading vs in the version and known_versions field has expired and been removed. Write 1.28.13 instead of v1.28.13.

Plugin API changes

@rule decorators have been re-typed, which should allow better call site return-type visibility (fewer Unknowns and Anys). Decorator factories of the form @rule(desc=..., level=..., ...) have also been strongly typed. This may cause typechecking errors for plugin authors, if the plugin is using incorrect types. However, this likely would have manifested as a runtime crash, otherwise.

The Pants repo now uses Ruff format in lieu of Black. This was not a drop-in replacement, with over 160 files modified (and about 5 MyPy errors introduced by Ruff's formatting). This should require no change from plugin authors.

Full Changelog

For the full changelog, see the individual GitHub Releases for this series: https://github.com/pantsbuild/pants/releases