pydantic / pydantic-core

Core validation logic for pydantic written in rust
MIT License
1.45k stars 247 forks source link

Plan to support free-threaded Python #1555

Open rostan-t opened 6 days ago

rostan-t commented 6 days ago

In free-threaded build, importing pydantic_core currently results in a segmentation fault. PyO3 v0.23 introduces support for free-threaded Python and addresses this issue. Is there any short-term plan to migrate to PyO3 0.23?

Currently I see the following blockers:

davidhewitt commented 4 days ago

Yes, I was testing PyO3 0.23 (when it was just a git branch) in #1450 and plan to proceed further with that upgrade this week.

There is potentially additional work required beyond your list to actually make free-threaded support ok, both here and in pydantic (where there are a bunch of caches which may or may not be thread-safe).