jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.41k stars 74 forks source link

Backport type annotation syntax support for older python versions #771

Open jcrist opened 2 hours ago

jcrist commented 2 hours ago
          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.

Originally posted by @ashb in https://github.com/jcrist/msgspec/issues/737#issuecomment-2470956504

jcrist commented 2 hours ago

A few options I see here:

I'd be open to either option 1 or 3. Thoughts @ashb? Is this something you'd be interested in contributing?

ashb commented 1 hour ago

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 commented 1 hour ago

Sounds good to me, thanks!

ashb commented 51 minutes ago

@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?