You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backport type annotation syntax support for older python versions #771
Pydantic handles this via https://github.com/alexmojaki/eval_type_backport -- is there any appetite for doing the same in msgspec? Happy to PR it if that it'd be supported.
Do as pydantic does (use eval_type_backport if installed, error otherwise and suggest the user install it). This keeps it as an optional dependency.
Add it as a mandatory dependency for older python versions. This would be our first mandatory dependency though, so I'm -0.5 on that.
Write our own implementation (looking at their code, I think there's a simpler way we could add support here). Downside here is this is all hacks and it'd be hacks we'd maintain rather than someone else.
I'd be open to either option 1 or 3. Thoughts @ashb? Is this something you'd be interested in contributing?
@jcrist Re testing: am I right in thinking that the cibuildwheel will test against multiple versions of python, so do I need to convice the GHA pipeline to run 3.9 with and without the dep installed?
There are ways to hack in testing without it I installed that wouldn't require another ci build - if you could just write tests for behavior with it installed I can add/fixup those afterward.
Activity
jcrist commentedon Nov 15, 2024
A few options I see here:
pydanticdoes (useeval_type_backportif installed, error otherwise and suggest the user install it). This keeps it as an optional dependency.I'd be open to either option 1 or 3. Thoughts @ashb? Is this something you'd be interested in contributing?
ashb commentedon Nov 15, 2024
In terms of effort I can spare l make time to do no.1, not sure I've got the spare cycles to do a full implementation.
Happy to pr approach 1
jcrist commentedon Nov 15, 2024
Sounds good to me, thanks!
ashb commentedon Nov 15, 2024
@jcrist Re testing: am I right in thinking that the cibuildwheel will test against multiple versions of python, so do I need to convice the GHA pipeline to run 3.9 with and without the dep installed?
jcrist commentedon Nov 15, 2024
There are ways to hack in testing without it I installed that wouldn't require another ci build - if you could just write tests for behavior with it installed I can add/fixup those afterward.