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.01k stars 59 forks source link

3.13 support #698

Open Tinche opened 1 month ago

Tinche commented 1 month ago

Howdy!

I'm trying to test cattrs on Python 3.13 (beta1). I've added a msgspec converter in the next version so now we optionally depend on msgspec, which means I can't test on 3.13 until you support it. ;)

The installation seems to be failing in GCC: https://github.com/python-attrs/cattrs/actions/runs/9333591881/job/25690767935

msgspec/_core.c:11254:15: error: too few arguments to function 
  ‘_PyLong_AsByteArray’
  11254 |     int out = _PyLong_AsByteArray((PyLongObject *)int128, buf, 16, 0, 
  0);
        |               ^~~~~~~~~~~~~~~~~~~
  In file included from 
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/longobject.h:10
  7,
                   from 
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/Python.h:72,
                   from msgspec/_core.c:9:
  /opt/hostedtoolcache/Python/3.13.0-beta.1/x64/include/python3.13/cpython/longobj
  ect.h:99:17: note: declared here
     99 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
        |                 ^~~~~~~~~~~~~~~~~~~
  error: command '/usr/bin/gcc' failed with exit code 1
max-muoto commented 3 weeks ago

@jcrist Put up a PR attempting to fix this if you can run the CI pipeline: https://github.com/jcrist/msgspec/pull/703