Skip to main content
Version: 2.4 (deprecated)

Upgrade tips

How we recommend staying up-to-date with Pants.


Reminder: change the pants_version to upgrade

Change the pants_version option in the [GLOBAL] scope in your pants.toml to upgrade.

You can see all releases at https://pypi.org/project/pantsbuild.pants/#history.

Upgrade one major release at a time

Per our Deprecation policy, deprecations must last a minimum of one major release. For example, something may be deprecated in 2.1.0 and then removed in 2.2.0.

This means that it is helpful to upgrade one major release at a time so that you can see all deprecation warnings.

You do not need to land every upgrade into your organization—often, you will want to upgrade your organization multiple versions at a time, e.g. 2.1.0 to 2.4.0. But, when you are working on the upgrade locally, it is helpful to iterate one version at a time.

To trigger deprecation warnings, we recommend running these commands:

$ ./pants
$ ./pants list :: > /dev/null
$ ./pants filedeps :: > /dev/null

It is also helpful to spot check that your main commands like lint, package, and test still work by running on a single target.

Use dev releases for the newest

As described in our Release strategy, we make weekly dev releases with all the latest features and bug fixes we've been working on. While dev releases are less stable, they mean you get access to improvements sooner.

If you encounter any blocking issues, you can easily roll back to a prior version by changing the pants_version option. (Please let us know the issue by opening a GitHub issue or messaging us on Slack).

Ignore deprecation messages with ignore_pants_warnings

Sometimes when upgrading, you will not have time to fully fix the deprecation. The ignore_pants_warnings option allows you to silence those deprecations.

The ignore_pants_warnings option expects a string with the start of the deprecation warning, like this:

pants.toml
[GLOBAL]
ignore_pants_warnings = [
"DEPRECATED: the pantsbuild.pants.contrib",
"DEPRECATED: the antlr, jaxb, ragel, and wire codegen backends",
]

Find any bugs or issues?

Please either open a GitHub issue or head over to Slack. We'd be happy to help and would appreciate knowing about the issue!