Update Pants internal Python to 3.14#22816
Conversation
…r implicitly creating loop
https://docs.python.org/3/whatsnew/3.14.html#changes-in-annotations-pep-649-and-pep-749 Removed ForwardRef patch that throws TypeErrors, but not needed as Python 3.10+ supports unions as pipes Updated default_unowned_deps for annotationlib (and whatever else came along)
There was a problem hiding this comment.
This was for annotationlib specifically, but looks like this hasn't been kept up in general - so I added whatever was available, and pulled back in some of the removals.
There was a problem hiding this comment.
I'm going back into this file to re-work what I had as a "pass the tests" solution, I don't like it - shouldn't stop review of the 3.14 branch though.
| field_set: TrivyTerraformFieldSet | ||
|
|
||
|
|
||
| def _is_terraform_deployment_field_set(fs: Any) -> TypeGuard[TerraformDeploymentFieldSet]: |
|
|
||
| # First version with working Python 3.11 support: | ||
| # https://github.com/pantsbuild/scie-pants/releases/tag/v0.12.2 | ||
| # TODO: Likely still need to update scie-pants |
There was a problem hiding this comment.
NOTE TO SELF... Need scie-pants update before this lands (though, I haven't actually tested scie-pants on this, I just don't think we have 3.14 support in there yet.
There was a problem hiding this comment.
Is there a tracking issue for proving out required scie-pants updates?
There was a problem hiding this comment.
I haven't looked at it yet, as I'm afk most of today and tomorrow. I don't think it's hard, just a thing to do (if it already doesn't work).
|
Reviewers: For all the lines changed, and the number of files/commits - the non-generated changeset is actually pretty low. I've tried to flag with comments and change of substance, otherwise it was updating default constraints, and re-generating actions or lockfiles. Might be worth putting eyeballs on the lock.metadata files to ensure I didn't screw anything up. This is ready for review, but won't be merged until |
|
FYI - For the eventual review notes (to be done once the scie-pants situation is sorted out), I'm going to copy/paste the 3.11 notes and also mention the pylint update: https://github.com/pantsbuild/pants/pull/21528/files#diff-93e66ca9f66b0b633d08d55724e0237f5d587679ac01baaff68b1e9110d492b7 |
There was a problem hiding this comment.
We can increase the default tool (ie: subsystems w/ builtin lockfiles) interpreter constraints range to include Python 3.14 without updating the version of Python that pants itself uses.
So, to minimize this PR (make it focused more on core code changes), would you please move the tool (subsystem) lockfile updates to a separate PR? That PR could be merged sooner as it would not be blocked on a scie-pants update.
Also, would you please capture the lockfile diffs, and include them in the PR description or PR comment(s)? Many of them don't have a difference, but it's nice to know which libraries get upgraded or removed.
There was a problem hiding this comment.
certifi 2025.8.3 --> 2025.11.12
charset-normalizer 3.4.3 --> 3.4.4
idna 3.10 --> 3.11
iniconfig 2.1.0 --> 2.3.0
pytest 8.4.2 --> 9.0.1
There was a problem hiding this comment.
coverage 7.10.7 --> 7.11.3
iniconfig 2.1.0 --> 2.3.0
execnet 2.1.1 --> 2.1.2
ipython 9.6.0 --> 9.7.0
matplotlib-inline 0.1.7 --> 0.2.1
pytest-asyncio 1.2.0 --> 1.3.0
Removed: typing-extensions
Feel free to point me at another discussion. But what does <4 get a user in practice? There won't be Python 3.42 wheels in the lockfile until someone re-generates it anyway. |
In short, for me it just means we can stick to |
|
@cognifloyd I merged the "update constraints" PR, and you were right - good idea. It removed like 80 files. |
There was a problem hiding this comment.
certifi 2025.8.3 --> 2025.11.12
pynacl 1.6.0 --> 1.6.1
There was a problem hiding this comment.
astroid 2.15.8 --> 4.0.2
isort 5.13.2 --> 7.0.0
platformdirs 4.4.0 --> 4.5.0
pylint 2.17.7 --> 4.0.3
Dropped: lazy-object-proxy, wrapt
There was a problem hiding this comment.
I manually created a diff for the other 3rdparty lockfiles. Do you have the lockfile diff for this one?
- Updating setproctitle to 1.3.7 for test
- Includes some "future proofing"
|
Alright, so this giant PR has been open for a while, bit-rotting away. I'm thinking it should probably get merged and then built upon - as lockfile updates are merge-conflict city. |
| return { | ||
| "name": "Install Python headers", | ||
| "run": "yum install -y python3.11-devel", | ||
| "run": "echo 'no-op'", |
There was a problem hiding this comment.
This is passing CI, so I'm hesitant to remove this in this massive PR
There was a problem hiding this comment.
Fine by me to clean up in a follow-up.
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| version: 23.x | ||
| - name: Install Python headers | ||
| run: yum install -y python3.11-devel |
There was a problem hiding this comment.
So this isn't a thing for Python 3.14?
There was a problem hiding this comment.
Not that I was able to see - it's the one above that I mentioned that since we're passing CI, I'd rather just status quo this one, and remove the call in a separate PR
Previous update to 3.11 here (#21528)
Edit: Segfault city over here in CI - not on my Mac M2Segfaults gone once updated pyo3 and setabi3as a feature. I'm going to remove that explicit feature and see what happens, as there is a pretty good chance the segfaults were maybe some stale rust cache/objects or something.Reasonable chance I'm an idiot - I think I forgot to update 3.14 in common.sh - causing all the segfaults.
Review and pre-merge notes:
(I'm on team "<4" for all subsystems, "<3.15" for Pants internal)(using "<3.15" - merged in Updated all python subsystem constraints to 3.14 #22890)scie-pantslikely needs update, and we need to update minimum SCIE-PANTS version in Pants (untested, so currently a theory - update was made a while ago, but for consistency with previous upgrades, we build this, then updates tests over there)Python Removals:
https://docs.python.org/3/whatsnew/3.12.html#removed
https://docs.python.org/3/whatsnew/3.13.html#removed
https://docs.python.org/3/whatsnew/3.14.html#removed
Relevant setuptools (this was done in an associated PR, still good to note that it was done for this update):
https://setuptools.pypa.io/en/latest/history.html#v66-1-0 (3.12 removed distutils and ImpImporter)
Associated PRs:
To keep this PR smaller