-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Python 3.12 support in 1.10.x? #9622
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
Comments
Agreed, I can work on this tomorrow once we get a fix out in
Let's try for this!
Haha, thanks for your work on this. Looking forward to collaborating more :). |
@sydney-runkle pydantic/pydantic-core#1299 this ? or are other fixes necessary? |
So... I don't think we can get compiled pydantic without going to Cython 3... We basically need cython/cython@03c498d and maybe other things, but that is at least what's yelling at me now.
Of course, after compiling it, I'm getting additional type errors. I'm able to coerce most of them, but jumping to cython3 was called out as "not happening" per Line 41 in 211910e
Plus, a lot of NameErrors from our friend
Unless we skip the requirement for compiled tests on 3.12, i'm guessing "full support" wont happen. I'm going to limit further testing until there is a discussion had. |
Ahhhh. Good find. We'll stick to that commitment to not support Folks can sort of use it unofficially without the compiled packages, given that we fixed the internal typing stuff. Going to close this and the related PR, given your findings. Great work! |
@sydney-runkle i have an alternative solution i'm about to push... give me a minute |
To clarify - we'll support 3.12, just not compile for 3.12. We can probably add the bound re |
We cannot use Cython 3 for 1.10.x, but we can get Cython 0.29.x to work on Python 3.12. The thing that's "blocking" is the CI pipeline, which is requiring We should be able to |
My PR has the cap for <3.13 in it, i'll push in a sec. |
Happy to review! |
@sydney-runkle could you confirm this assumption? Do you cythonize the wheels that are generated? if so, is tracing enabled when they are built? If tracing is a requirement for cythonized wheels then it's all moot. |
But why? I don't see the benefit of disallowing pip to install pydantic 1.10.17+ (unless pydantic 1.0 works fine at least for some use cases on Python 3.13. I'm not asking you to support this, but why prevent it? >>> import sys
>>> sys.version
'3.13.0b2 (main, Jun 7 2024, 02:27:16) [GCC 12.2.0]'
>>> import pydantic
>>> pydantic.VERSION
StrictVersion ('1.0')
>>> class User(pydantic.BaseModel):
... id: int
... name = 'John Doe'
...
>>> user = User(id=1)
>>> print(user.dict())
{'id': 1, 'name': 'John Doe'} |
I don't really want to put words in their mouth or answer for them, I'm not a maintainer, but preventing it allows them to determine if support will be extended vs being strong armed into supporting it because thousands of users are able to install it and assume that if they can install it that its supposed to be supported. Its "explicit support" vs "implied support" It may work in most usecases in 3.13. It may even pass the full test suite, though i have strong doubts on the cythonized builds working. In the end, just because it works doesn't mean its supported. It may be nontrivial to add full 3.13 support or maybe they don't want to be on the hook for dealing with another full life cycle of a release because there may be compatibility issues between bugfix versions like we just had with 3.12.4 and they need to focus developer time elsewhere, like pydantic v2 or a new product, instead of on a pydantic 1.10.x thats in maintenance mode. I know #9613 is going to be an issue at some point. My 2Β’ |
Going to tear this conversation off into a different issue, because it does seem pertinent and isn't straightforward |
Initial Checks
Description
Right now, we have have users using pydantic on 3.12 despite no advertised support. Part of this is due to the python requirement being only 3.7 and without a cap.
A breaking change was introduced in 3.12.4, otherwise 1.10.15 seems to mostly play nice.
However, a number of changes are required to get tests to pass on python 3.12.
This list is non-exhaustive:
A number of tests still fail, likely due to string format changes between CPython and tools
In light of #9607, I think a 1.10.16 release should be tagged, but with python capped at <3.13.
If there is a desire to add python 3.12 support, it will take some discussion and some reworking of the tests. If we want python 3.12 support in 1.10.x, a subsequent series of commits can add that support. If we do not, we can tag 1.10.17 with python <3.12.
This would allow users to pin their dependency on 1.10.16 if they need an immediate fix. This will also force a migration to pydantic v2.
But these are pre-caffinated ruminations, so open to thoughts.
@sydney-runkle
Example Code
No response
Python, Pydantic & OS Version
Affected Components
.model_dump()
and.model_dump_json()
model_construct()
, pickling, private attributes, ORM modeThe text was updated successfully, but these errors were encountered: