Skip to content

Audit and update requirements for Python tools. (cherrypick #18431)#18460

Merged
benjyw merged 1 commit intopantsbuild:2.16.xfrom
benjyw:cherry-pick-18431-to-2.16.x
Mar 10, 2023
Merged

Audit and update requirements for Python tools. (cherrypick #18431)#18460
benjyw merged 1 commit intopantsbuild:2.16.xfrom
benjyw:cherry-pick-18431-to-2.16.x

Conversation

@benjyw
Copy link
Contributor

@benjyw benjyw commented Mar 9, 2023

Specifically, it added a requirements option for each tool that is
expected to contain very loose requirements that we expect
Pants to support.

We initialized the default value for that option from the existing
version andextra_requirements fields. However those were often
overly-constrained, sometimes to a single version.

This PR audits all the tools' defaults and in various cases does one or
both of:

  1. Update default_version to a newer version so we can regen more
    up-to-date lockfiles.
  2. Explicitly set default_requirements to something loose but likely
    compatible.

Of course it's hard to know which currently available tool versions
Pants is compatible with, unless we test against them. And it's impossible
to know which future versions Pants will remain compatible with.

So we assume that tools are semver-adherent, so that floating up in the
same major version is safe. Updating to newer versions lets us at least start
to test against some newer versions, and is also overdue, since many of
our default tool versions are quite old. The proof that these upgrades
are compatible is in the passing tests.

At some point soon we will deprecate version and extra_requirements
in favor of using user lockfiles for custom tool versions.

@benjyw benjyw requested a review from kaos March 9, 2023 22:34
@benjyw benjyw changed the base branch from main to 2.16.x March 9, 2023 22:38
Specifically, it added a `requirements` option for each tool that is
expected to contain very loose requirements that we expect
Pants to support.

We initialized the default value for that option from the existing
`version` and`extra_requirements` fields. However those were often
overly-constrained, sometimes to a single version.

This PR audits all the tools' defaults and in various cases does one or
both of:

1. Update `default_version` to a newer version so we can regen more
up-to-date lockfiles.
2. Explicitly set `default_requirements` to something loose but likely
compatible.

Of course it's hard to know which currently available tool versions
Pants is compatible with, unless we test against them. And it's impossible
to know which future versions Pants will remain compatible with.

So we assume that tools are semver-adherent, so that floating up in the
same major version is safe. Updating to newer versions lets us at least start
to test against some newer versions, and is also overdue, since many of
our default tool versions are quite old. The proof that these upgrades
are compatible is in the passing tests.

At some point soon we will `deprecate` `version` and `extra_requirements`
in favor of using user lockfiles for custom tool versions.
@benjyw benjyw force-pushed the cherry-pick-18431-to-2.16.x branch from 7ce8f68 to e5ddea3 Compare March 9, 2023 23:38
@benjyw benjyw merged commit 702481a into pantsbuild:2.16.x Mar 10, 2023
@benjyw benjyw deleted the cherry-pick-18431-to-2.16.x branch March 10, 2023 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants