Skip to content

Add support for Python 3.14 #10467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 7, 2025
Merged

Add support for Python 3.14 #10467

merged 6 commits into from
Aug 7, 2025

Conversation

jacobtylerwalls
Copy link
Member

@jacobtylerwalls jacobtylerwalls commented Jul 28, 2025

Type of Changes

Type
✨ New feature

@jacobtylerwalls jacobtylerwalls added Maintenance Discussion or action around maintaining pylint or the dev workflow python 3.14 Needs astroid update Needs an astroid update (probably a release too) before being mergable labels Jul 28, 2025
@jacobtylerwalls
Copy link
Member Author

Blocked by pylint-dev/astroid#2789

@jacobtylerwalls jacobtylerwalls added the Blocked 🚧 Blocked by a particular issue label Jul 28, 2025
@jacobtylerwalls jacobtylerwalls added this to the 4.0.0 milestone Jul 28, 2025

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@cdce8p
Copy link
Member

cdce8p commented Aug 6, 2025

#10480 will help resolve a lot of the issues here. On the astroid side I just created pylint-dev/astroid#2793 to add basic support for TemplateStr.

This comment has been minimized.

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas removed Blocked 🚧 Blocked by a particular issue Needs astroid update Needs an astroid update (probably a release too) before being mergable labels Aug 6, 2025
@Pierre-Sassoulas
Copy link
Member

Not blocked anymore with astroid 4.0.0b1. Not sure how to best deal with the no-member / no-name-in-module though. I'm not sure that the conditional functional test based on the interpreter are going to work for the expected output too.

This comment has been minimized.

@cdce8p
Copy link
Member

cdce8p commented Aug 6, 2025

Not blocked anymore with astroid 4.0.0b1. Not sure how to best deal with the no-member / no-name-in-module though. I'm not sure that the conditional functional test based on the interpreter are going to work for the expected output too.

Will take a proper look at it soon. It at least uncovered a false-positive for used-before-assignment I'll address in a separate PR.

@cdce8p
Copy link
Member

cdce8p commented Aug 7, 2025

CI is looking good now. Interestingly I'm still getting an error locally.

pytest tests/test_functional.py::test_functional[regression_5408]

Crashes with Abort trap: 6 on my machine, MacOS ARM with 3.14.0rc1. If I compile cpython from source it works fine. Maybe it's a fluke?

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.87%. Comparing base (d363fca) to head (8853532).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10467   +/-   ##
=======================================
  Coverage   95.86%   95.87%           
=======================================
  Files         176      176           
  Lines       19168    19168           
=======================================
+ Hits        18376    18377    +1     
+ Misses        792      791    -1     
Files with missing lines Coverage Δ
pylint/checkers/base/basic_error_checker.py 95.41% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pierre-Sassoulas
Copy link
Member

Amazing ! Regarding the abort trap, I don't know, but I think that's outside pylint's purview.

I don't remember if I was the one who removed the new "Forward" functional tests specifically for 3.14 or if it was you (importing from annotationlib instead of typing), do you think it make sense to add it back ?

@cdce8p
Copy link
Member

cdce8p commented Aug 7, 2025

Amazing ! Regarding the abort trap, I don't know, but I think that's outside pylint's purview.

Would you mind running the test on your machine? If the error is more common, it might still be related / caused by pylint or astroid. Though at the moment I suspect it's just some issue on my machine.

I don't remember if I was the one who removed the new "Forward" functional tests specifically for 3.14 or if it was you (importing from annotationlib instead of typing), do you think it make sense to add it back ?

I removed it while pushing 8c4750a. It's not really necessary since with pylint-dev/astroid#2795, typing.ForwardRef just delegates to annotationlib.ForwardRef anyway. Without 8c4750a the test case would fail even with the import from typing.

@cdce8p cdce8p marked this pull request as ready for review August 7, 2025 11:29
@cdce8p cdce8p added Enhancement ✨ Improvement to a component and removed Maintenance Discussion or action around maintaining pylint or the dev workflow labels Aug 7, 2025
@cdce8p cdce8p changed the title Support Python 3.14 Add support for Python 3.14 Aug 7, 2025
Copy link
Contributor

github-actions bot commented Aug 7, 2025

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 8853532

@Pierre-Sassoulas
Copy link
Member

Would you mind running the test on your machine?

Sure, but I have ubuntu 24.04.2 LTS (tested with python 3.14 alpha 6 and python 3.14 rc1 installed with uv), no crashes.

If the error is more common, it might still be related / caused by pylint or astroid.

"revealed" right ? As in it's a bug in cpython that we can maybe avoid triggering with some guesswork ?

@cdce8p
Copy link
Member

cdce8p commented Aug 7, 2025

If the error is more common, it might still be related / caused by pylint or astroid.

"revealed" right ? As in it's a bug in cpython that we can maybe avoid triggering with some guesswork ?

Yeah, if it was just on my machine it's probably nothing. However, if it can be reproduced reliably that's a different story.
Looks like it's the latter. Was able to reproduce it in a CI run: https://github.com/cdce8p/pylint/actions/runs/16805911305/job/47598155830

Removing these lines here is enough for the error to go away but that's not really the point.

class Child(_Child):
def patch(cls):
MyClass.sub_class.inner_class = cls

Looks like I need to investigate that a bit further.

--
Unless you think otherwise I'd say it doesn't block this PR though. The changes here are itself correct and the issue seems to be with cpython on MacOS exclusively AFAICT at the moment.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 945880e into main Aug 7, 2025
47 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the python-314 branch August 7, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component python 3.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants