MKuranowski / aiocsv

Python: Asynchronous CSV reading/writing
https://pypi.org/project/aiocsv/
MIT License
67 stars 9 forks source link

python 3.12 compatibility #17

Closed ashnack closed 11 months ago

ashnack commented 12 months ago

When building in python 3.12 (in the dockerfile python:slim) :

52.51   × Building wheel for aiocsv (pyproject.toml) did not run successfully.
52.51   │ exit code: 1
52.51   ╰─> [116 lines of output]
52.51       running bdist_wheel
52.51       running build
52.51       running build_py
52.51       file aiocsv.py (for module aiocsv) not found
52.51       creating build
52.51       creating build/lib.linux-x86_64-cpython-312
52.51       creating build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/__init__.py -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/parser.py -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/protocols.py -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/readers.py -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/writers.py -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/py.typed -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       copying aiocsv/_parser.pyi -> build/lib.linux-x86_64-cpython-312/aiocsv
52.51       file aiocsv.py (for module aiocsv) not found
52.51       running build_ext
52.51       building 'aiocsv._parser' extension
52.51       creating build/temp.linux-x86_64-cpython-312
52.51       creating build/temp.linux-x86_64-cpython-312/aiocsv
52.51       gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/venv/include -I/usr/local/include/python3.12 -c aiocsv/_parser.c -o build/temp.linux-x86_64-cpython-312/aiocsv/_parser.o
52.51       aiocsv/_parser.c: In function ‘__Pyx_PyErr_ExceptionMatchesInState’:
52.51       aiocsv/_parser.c:5412:32: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        5412 |     PyObject *exc_type = tstate->curexc_type;
52.51             |                                ^~
52.51       aiocsv/_parser.c: In function ‘__Pyx_ErrRestoreInState’:
52.51       aiocsv/_parser.c:5425:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        5425 |     tmp_type = tstate->curexc_type;
52.51             |                      ^~
52.51       aiocsv/_parser.c:5426:23: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        5426 |     tmp_value = tstate->curexc_value;
52.51             |                       ^~
52.51       aiocsv/_parser.c:5427:20: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        5427 |     tmp_tb = tstate->curexc_traceback;
52.51             |                    ^~
52.51       aiocsv/_parser.c:5428:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        5428 |     tstate->curexc_type = type;
52.51             |           ^~
52.51       aiocsv/_parser.c:5429:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        5429 |     tstate->curexc_value = value;
52.51             |           ^~
52.51       aiocsv/_parser.c:5430:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        5430 |     tstate->curexc_traceback = tb;
52.51             |           ^~
52.51       aiocsv/_parser.c: In function ‘__Pyx_ErrFetchInState’:
52.51       aiocsv/_parser.c:5436:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        5436 |     *type = tstate->curexc_type;
52.51             |                   ^~
52.51       aiocsv/_parser.c:5437:20: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        5437 |     *value = tstate->curexc_value;
52.51             |                    ^~
52.51       aiocsv/_parser.c:5438:17: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        5438 |     *tb = tstate->curexc_traceback;
52.51             |                 ^~
52.51       aiocsv/_parser.c:5439:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        5439 |     tstate->curexc_type = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c:5440:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        5440 |     tstate->curexc_value = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c:5441:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        5441 |     tstate->curexc_traceback = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c: In function ‘__Pyx_Raise’:
52.51       aiocsv/_parser.c:6577:34: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        6577 |         PyObject* tmp_tb = tstate->curexc_traceback;
52.51             |                                  ^~
52.51       aiocsv/_parser.c:6580:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        6580 |             tstate->curexc_traceback = tb;
52.51             |                   ^~
52.51       aiocsv/_parser.c: In function ‘__Pyx_Coroutine_MethodReturn’:
52.51       aiocsv/_parser.c:1474:45: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        1474 | #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
52.51             |                                             ^~
52.51       aiocsv/_parser.c:7121:14: note: in expansion of macro ‘__Pyx_PyErr_Occurred’
52.51        7121 |         if (!__Pyx_PyErr_Occurred()) {
52.51             |              ^~~~~~~~~~~~~~~~~~~~
52.51       aiocsv/_parser.c: In function ‘__Pyx__Coroutine_GetAwaitableIter’:
52.51       aiocsv/_parser.c:8240:53: error: ‘PyGenObject’ has no member named ‘gi_code’
52.51        8240 |     if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
52.51             |                                                     ^~
52.51       aiocsv/_parser.c:8240:102: error: ‘PyGenObject’ has no member named ‘gi_code’
52.51        8240 |     if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
52.51             |                                                                                                      ^~
52.51       aiocsv/_parser.c: In function ‘__Pyx__GetException’:
52.51       aiocsv/_parser.c:8707:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        8707 |     local_type = tstate->curexc_type;
52.51             |                        ^~
52.51       aiocsv/_parser.c:8708:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        8708 |     local_value = tstate->curexc_value;
52.51             |                         ^~
52.51       aiocsv/_parser.c:8709:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        8709 |     local_tb = tstate->curexc_traceback;
52.51             |                      ^~
52.51       aiocsv/_parser.c:8710:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        8710 |     tstate->curexc_type = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c:8711:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_value’
52.51        8711 |     tstate->curexc_value = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c:8712:11: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_traceback’
52.51        8712 |     tstate->curexc_traceback = 0;
52.51             |           ^~
52.51       aiocsv/_parser.c:8718:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘curexc_type’
52.51        8718 |     if (unlikely(tstate->curexc_type))
52.51             |                        ^~
52.51       aiocsv/_parser.c:1276:43: note: in definition of macro ‘unlikely’
52.51        1276 |   #define unlikely(x) __builtin_expect(!!(x), 0)
52.51             |                                           ^
52.51       aiocsv/_parser.c: At top level:
52.51       aiocsv/_parser.c:11352:1: warning: ‘__Pyx_PyAsyncGen_Fini’ defined but not used [-Wunused-function]
52.51       11352 | __Pyx_PyAsyncGen_Fini(void)
52.51             | ^~~~~~~~~~~~~~~~~~~~~
52.51       aiocsv/_parser.c:7652:31: warning: ‘__Pyx__Coroutine_New’ defined but not used [-Wunused-function]
52.51        7652 | static __pyx_CoroutineObject *__Pyx__Coroutine_New(
52.51             |                               ^~~~~~~~~~~~~~~~~~~~
52.51       error: command '/usr/bin/gcc' failed with exit code 1
52.51       [end of output]
52.51   
52.51   note: This error originates from a subprocess, and is likely not a problem with pip.
52.51   ERROR: Failed building wheel for aiocsv

I know aiohttp had a similar issue with python 3.12 before version 3.9.0b0, so the solution might be the same.

MKuranowski commented 11 months ago

Fixed in 5b07e10879ba60ec6756d975eb4fddc0adcd76b8, will publish a release in a few minutes