ICRAR / ijson

Iterative JSON parser with Pythonic interfaces
http://pypi.python.org/pypi/ijson/
Other
849 stars 51 forks source link

Wheels for Python 3.12 with yajl2_c backend #105

Closed eantkaj closed 1 year ago

eantkaj commented 1 year ago

Is your feature request related to a problem? Please describe. After installing the ijson package on Python 3.12, the performant yajl2_c backend is not available.

Describe the solution you'd like cibuildwheel should be able to produce wheels for 3.12 now. Could there be a new release run for ijson to enable Python 3.12 users to enjoy wheels and avoid installing and compiling extra things?

Describe alternatives you've considered One would need to install yajl2-dev and a compilation toolchain on all environments where they expect to use ijson, which is not very convenient nor practical.

Additional context Fails on Python 3.12:

  ✔ Install ijson 3.2.3 successful
--------
Python 3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
>>> from ijson.backends import yajl2_c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".venv/lib/python3.12/site-packages/ijson/backends/yajl2_c.py", line 13, in <module>
    from . import _yajl2
ImportError: cannot import name '_yajl2' from 'ijson.backends' (.venv/lib/python3.12/site-packages/ijson/backends/__init__.py)

Works on Python 3.11:

  ✔ Install ijson 3.2.3 successful
--------
Python 3.11.5 (v3.11.5:cce6ba91b3, Aug 24 2023, 10:50:31) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
>>> from ijson.backends import yajl2_c
>>> 

PS. Thank you so much for the awesome library 🙏

rtobar commented 1 year ago

@eantkaj thanks for reporting this! While I made sure already in 3.2.2 that Python 3.12 was properly supported, that version of CPython was still in alpha/beta state, so cibuildwheels wasn't building wheels yet. Even when 3.2.3 was released that was still the case. I've just pushed a dummy branch to trigger the GitHub Actions, after which I'll manually upload the generated 3.12 wheels (no need for a new release just for that).

rtobar commented 1 year ago

Woops, that re-run didn't quite work. That's because our CI was using Python 3.7 to run cibuildwheel, which stopped supporting that host python version some time ago (and therefore was probably partly to blame for the absence of 3.12 wheels). I've updated that python version on CI to 3.12 and will try again.

rtobar commented 1 year ago

Wheels generated and uploaded, please verify and close this issue if you find they are installing correctly.

eantkaj commented 1 year ago

Works like a charm. Thank you!

  ✔ Install ijson 3.2.3 successful
--------
Python 3.12.0 (v3.12.0:0fb18b02c8, Oct  2 2023, 09:45:56) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
>>> from ijson.backends import yajl2_c
>>>