Skip to content

Remove deprecated pex_binary(platforms=...) for 2.22, deprecate resolve_local_platforms#20823

Merged
huonw merged 1 commit intomainfrom
huonw/rm-pex-platforms
Apr 27, 2024
Merged

Remove deprecated pex_binary(platforms=...) for 2.22, deprecate resolve_local_platforms#20823
huonw merged 1 commit intomainfrom
huonw/rm-pex-platforms

Conversation

@huonw
Copy link
Copy Markdown
Contributor

@huonw huonw commented Apr 20, 2024

This field was deprecated in #20012, released in 2.19. We've now branched for 2.21 and thus main is prepping for 2.22. So, the deprecation has expired!

In that PR, there was discussion about working out whether this should remain for longer. This has been deprecated for several releases now, and it's being removed early in the 2.22 release cycle: if someone comments, we can reinstate/reconsider.


Also, as part of this, I noticed the resolve_local_platforms field and option now seem to be meaningless: the underlying pex --resolve-local-platforms field is documented as When --platforms are specified, .... Thus, this deprecates that field and the global option for 2.24.

@huonw huonw force-pushed the huonw/rm-pex-platforms branch from 9eaed5a to cd0764f Compare April 20, 2024 10:44
@huonw huonw marked this pull request as ready for review April 20, 2024 10:46
@huonw huonw requested review from benjyw and thejcannon April 20, 2024 10:49
@huonw huonw changed the title Remove deprecated PexPlatformsField for 2.22, deprecate resolve_local_platforms Remove deprecated pex_binary(platforms=...) for 2.22, deprecate resolve_local_platforms Apr 20, 2024
@huonw huonw merged commit 164f322 into main Apr 27, 2024
@huonw huonw deleted the huonw/rm-pex-platforms branch April 27, 2024 08:27
huonw added a commit that referenced this pull request Sep 16, 2024
…21416)

In #20823 (included in 2.22.0.dev0 and thus the recently released
2.22.0), we deprecated the `resolve_local_platforms` field on
`pex_binary` and the `[pex-binary-defaults]` option version too.

We're about to do 2.24.0.dev0, and thus the deprecation has expired =>
time to remove!

class PexResolveLocalPlatformsField(TriBoolField):
alias = "resolve_local_platforms"
removal_version = "2.24.0.dev0"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pex --resolve-local-platforms option applies to both --platform and --complete-platform foreign targets despite what the CLI help says (--resolve-local-platforms existed before --complete-platform was introduced and I failed to update the help). Since --platform went away but --complete-platform did not, --resolve-local-platforms can still be useful. In fact Pants uses it internally for FAAS:

# When we're executing Pex on Linux, allow a local interpreter to be resolved if
# available and matching the AMI platform.
"--resolve-local-platforms",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs fix here: pex-tool/pex#2759

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example useful case here: altana-ai/repro-pants-debugger-issue#1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for identifying this and for letting me know!

(I've filed #22247 so we don't forget)

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.

3 participants