Skip to content

Conversation

@cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Oct 8, 2025

No description provided.

@github-actions

This comment has been minimized.

@cdce8p cdce8p changed the title Run CI with Python 3.14.0 final Run CI for Python 3.14.0 and free-threading Oct 8, 2025
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
Copy link
Collaborator Author

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

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.

@github-actions

This comment has been minimized.

@cdce8p
Copy link
Collaborator Author

cdce8p commented Oct 8, 2025

Looks like there is just one flaky test for the free-threading build.

mypy/test/teststubgen.py::StubgenPythonSuite::stubgen.test::testImportedModuleHardExits_import

@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from 91f1414 to 05d345b Compare October 9, 2025 22:16
@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from 05d345b to 27b04ec Compare October 13, 2025 23:37
@github-actions

This comment has been minimized.

@sterliakov sterliakov mentioned this pull request Oct 17, 2025
@ngoldbaum
Copy link

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.

@emmatyping
Copy link
Member

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 sys.version_info == (3, 14, 0)), but I don't think that can be encoded in our test harness at the moment.

@cdce8p
Copy link
Collaborator Author

cdce8p commented Oct 18, 2025

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.

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.

@cdce8p cdce8p changed the title Run CI for Python 3.14.0 and free-threading Run CI for Python 3.14 free-threading Oct 18, 2025
@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from 27b04ec to d8bd3f8 Compare October 18, 2025 18:53
@cdce8p cdce8p marked this pull request as draft October 18, 2025 18:55
@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from d8bd3f8 to f07b4c1 Compare December 3, 2025 07:01
@github-actions

This comment has been minimized.

@cdce8p
Copy link
Collaborator Author

cdce8p commented Dec 3, 2025

@ngoldbaum Looks like lxml is the only issue left. Any updates?

If not we could either not install lxml for 3.14 or check if the GIL is disabled with sys. _is_gil_enabled before running the lxml tests. https://docs.python.org/3/library/sys.html#sys._is_gil_enabled

@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from f706b88 to f36f722 Compare December 3, 2025 14:01
@ngoldbaum
Copy link

See lxml/lxml#477 (comment) for the latest update on lxml. Thanks for working on this!

@github-actions

This comment has been minimized.

@cdce8p cdce8p marked this pull request as ready for review December 3, 2025 14:23
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():

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.

Copy link
Collaborator Author

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.

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.

@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the actions-use-3.14.0 branch from 90a77f7 to a79233d Compare December 3, 2025 15:23
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants