-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Run CI for Python 3.14 free-threading #20029
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
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
test-requirements.in
Outdated
| attrs>=18.0 | ||
| filelock>=3.3.0 | ||
| lxml>=5.3.0; python_version<'3.15' | ||
| lxml>=5.3.0; python_version<'3.14' # lxml doesn't ship wheels for cp314t yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be updated if PEP 780 get's accepted. It's still a draft though at the moment.
https://peps.python.org/pep-0780/#examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully lxml will have a free-threaded release out soon. My next task today is to run the lxml tests under TSan to hopefully validate a final set of fixes.
This comment has been minimized.
This comment has been minimized.
|
Looks like there is just one flaky test for the mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testImportedModuleHardExits_import |
91f1414 to
05d345b
Compare
This comment has been minimized.
This comment has been minimized.
05d345b to
27b04ec
Compare
This comment has been minimized.
This comment has been minimized.
|
Hi! I missed this and opened #20076. I think the failing test in the CI will be fixed when Python 3.14.1 comes out. The issue is fixed in the 3.15, 3.13, and as of yesterday also the 3.14 development branch. The 3.14 release schedule says we might have to wait until December for 3.14.1, so it might make sense to simply skip the failing tests for now. |
I think this makes sense. I'd normally suggest we do a |
Normally I'd agree. However it might be a bit more difficult. AFAICT it's not just one test but up to 5-10 different ones (?) which are failing each time. Not sure I'm comfortable with skipping this many. Yes, December is still two months away, however users are still able to use the pure Python version so there is at least an option for them. Technically they could also compile mypy from the sdist themselves. It might be better to just wait and add the free-threading version then. |
27b04ec to
d8bd3f8
Compare
This comment has been minimized.
This comment has been minimized.
d8bd3f8 to
f07b4c1
Compare
This comment has been minimized.
This comment has been minimized.
|
@ngoldbaum Looks like lxml is the only issue left. Any updates? If not we could either not install |
This comment has been minimized.
This comment has been minimized.
f706b88 to
f36f722
Compare
|
See lxml/lxml#477 (comment) for the latest update on lxml. Thanks for working on this! |
This comment has been minimized.
This comment has been minimized.
mypy/report.py
Outdated
|
|
||
| try: | ||
| from lxml import etree # type: ignore[import-untyped] | ||
| if sys.version_info >= (3, 14) and not sys._is_gil_enabled(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GIL can be re-enabled on the free-threaded build by importing an extension that doesn't declare support for running without the GIL.
What matters here is the ABI, not whether the GIL is enabled at runtime.
Instead of sys._is_gil_enabled(), I'd use not bool(sysconfig.get_config_var("Py_GIL_DISABLED)). Future Python versions will have sys.abi_flags to get information like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 Pushed a new commit.
Ideally I'd prefer to just not install lxml at all for free-threading builds but that's not supported yet. There was some progress on the packaging PEP but it might have stalled out again unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working with @zklaus on the packaging PEP! It's hard to make packaging changes but he's working on it still.
This comment has been minimized.
This comment has been minimized.
90a77f7 to
a79233d
Compare
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
No description provided.