Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Python 3.12 and Python 3.13 as probe-able versions (#448)
This (theoretically) adds support for running future Pants PEXes that requires Python 3.12 or 3.13 by adding them as versions that the fallback "probing" loop will query. This will hopefully reduce how often we need to force users to upgrade their scie-pants runner, because current versions of scie-pants will support more Python versions, giving us a bit more flexibility with doing internal upgrades. (Worst case: there's a problem in this PR and it doesn't work for the actual future 3.12/3.13-using versions of Pants... but, that's seemingly no worse than we were before, without any support at all.) ## Background Scie-pants downloads and runs PEXes from Pants releases. These PEXes require a specific Python version, that's indicated in the URL, e.g. <https://github.com/pantsbuild/pants/releases/download/release_2.25.0.dev4/pants.2.25.0.dev4-cp311-darwin_arm64.pex> (NB. `cp311`). There's two aspects of scie-pants working with these: - hard-coding the different Python versions, to have lift/ptex be able to download the right interpreter (in `scie-pants.toml`) - logic to find the right artifact to download: https://github.com/pantsbuild/scie-pants/blob/9d73b15a0f602de1359c842a7b153b1dda53c7e9/tools/src/scie_pants/pants_version.py#L239-L253 - first guess the URL based on the requested version, with hard-coded known cut-overs: https://github.com/pantsbuild/scie-pants/blob/9d73b15a0f602de1359c842a7b153b1dda53c7e9/tools/src/scie_pants/pants_version.py#L27-L33 - if that fails, then fallback to guessing successive URLs based on the known-versions (i.e. several requests to probe the possible request artifacts) The fallback feature allows us to have current scie-pants support potential future versions of Pants, to reduce how often users are forced to upgrade their scie-pants runner installation. ## Example Imagine we release 2.34.0 with cp312 support and had made no other changes, this gives an artifact like `pants.2.34.0-cp312-darwin_arm64.pex`: 1. Scie-pants' initial guess tries to download `pants.2.34.0-cp311-darwin_arm64.pex` (because 2.34.0 >= 2.25.0.dev0, which is the hard-coded cp311 threshold in `PANTS_PYTHON_VERSIONS`), but this would fail. 2. The fallback kicks in to go through the various `PYTHON_IDS`. It eventually hits `pants.2.34.0-cp312-darwin_arm64.pex` and succeeds, getting Pants 2.34 running for that user! Without this PR, step 2 would only run through 3.8 - 3.11, not find the artifact, and thus the overall installation would fail. (Hard-coding the version threshold once we know it will make this bootstrapping (slightly) more efficient/send fewer requests, but the fallback + extra versions means scie-pants is at least functional.)
- Loading branch information