Skip to content

ci: support Python 3.14 #5646

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented May 8, 2025

Description

Let's try beta 1!

Suggested changelog entry:

* Support Python 3.14 (beta 1)

@henryiii
Copy link
Collaborator Author

henryiii commented May 8, 2025

FAILED test_methods_and_attributes.py::test_dynamic_attributes - AssertionError: assert not True
 +  where True = hasattr(<pybind11_tests.methods_and_attributes.DynamicClass object at 0x7f3c250dd750>, 'foo')
FAILED test_operator_overloading.py::test_return_set_of_unhashable - assert False
 +  where False = <built-in method startswith of str object at 0x7f3c252b3030>('unhashable type:')
 +    where <built-in method startswith of str object at 0x7f3c252b3030> = "cannot use 'pybind11_tests.operators.HashMe' as a set element (unhashable type: 'pybind11_tests.operators.HashMe')".startswith
 +      where "cannot use 'pybind11_tests.operators.HashMe' as a set element (unhashable type: 'pybind11_tests.operators.HashMe')" = str(TypeError("cannot use 'pybind11_tests.operators.HashMe' as a set element (unhashable type: 'pybind11_tests.operators.HashMe')"))
 +        where TypeError("cannot use 'pybind11_tests.operators.HashMe' as a set element (unhashable type: 'pybind11_tests.operators.HashMe')") = TypeError('Unable to convert function return value to a Python type! The signature was\n\t() -> set[pybind11_tests.operators.HashMe]').__cause__
 +          where TypeError('Unable to convert function return value to a Python type! The signature was\n\t() -> set[pybind11_tests.operators.HashMe]') = <ExceptionInfo TypeError('Unable to convert function return value to a Python type! The signature was\n\t() -> set[pybind11_tests.operators.HashMe]') tblen=1>.value
FAILED test_pickling.py::test_roundtrip_with_dict[PickleableWithDict] - AttributeError: 'pybind11_tests.pickling.PickleableWithDict' object has no attribute 'dynamic'
FAILED test_pickling.py::test_roundtrip_with_dict[PickleableWithDictNew] - AttributeError: 'pybind11_tests.pickling.PickleableWithDictNew' object has no attribute 'dynamic'

@rwgk
Copy link
Collaborator

rwgk commented May 8, 2025

The tests/test_operator_overloading.py failure is a trivial fix, but I'm not sure about the other two. They could easily steal a couple hours each to take care of...

@henryiii
Copy link
Collaborator Author

henryiii commented May 9, 2025

Looks like two errors: py::hash isn’t working, and dynamic attributes are broken. @vstinner I don’t see anything in https://docs.python.org/3.14/whatsnew/3.14.html#id11 that would seem to indicate changes here.

I can try bisecting later.

@vstinner
Copy link
Contributor

vstinner commented May 9, 2025

  • where <built-in method startswith of str object at 0x7f3c252b3030> = "cannot use 'pybind11_tests.operators.HashMe' as a set element (unhashable type: 'pybind11_tests.operators.HashMe')".startswith

Yeah, I changed the error message in: python/cpython#132825

You may be able to fix your test by replacing "startswith" with "contains" ("in").

@henryiii
Copy link
Collaborator Author

henryiii commented May 9, 2025

Wow, that's a huge improvement:

Screenshot 2025-05-09 at 12 00 54 PM

Love the syntax highlighting in the REPL now, too. :)

I thought there was another issue with py::hash, but I see it's just that, so it's only the dynamic change now. I still don't see anything in the upgrade guide. But one issue should be easy to bisect.

@vstinner
Copy link
Contributor

vstinner commented May 9, 2025

I still don't see anything in the upgrade guide

The change was documented 1h ago: python/cpython@de28651.

@henryiii
Copy link
Collaborator Author

henryiii commented May 9, 2025

BTW, we are also running into https://gitlab.kitware.com/cmake/cmake/-/issues/26926 on Windows, CMake is confused and trying to use a free-threaded lib. I've seen that with scikit-build-core, too, in scikit-build/scikit-build-core#1074.

@henryiii
Copy link
Collaborator Author

henryiii commented May 9, 2025

Bisecting this shows it was broken by python/cpython#123192. I've commented on python/cpython#115776.

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/chore/py314 branch from 805e5b1 to 4ff28e2 Compare May 13, 2025 18:44
@henryiii henryiii force-pushed the henryiii/chore/py314 branch from 4ff28e2 to 574a024 Compare May 13, 2025 18:49
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