openzim / python-libzim

Libzim binding for Python: read/write ZIM files in Python
https://pypi.org/project/libzim/
GNU General Public License v3.0
62 stars 20 forks source link

Cython compilation error with python 3.9.0+ (on ubuntu 20.04) #88

Closed amirouche closed 3 years ago

amirouche commented 3 years ago
% pip --version
pip 20.1.1 from /home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/lib/python3.9/site-packages/pip (python 3.9)
% python --version
Python 3.9.0+
% pip install libzim
Collecting libzim
  Using cached libzim-0.0.3.post0.tar.gz (103 kB)
  Installing build dependencies ... error

stdout ends with:

      copying Cython/Utility/CppSupport.cpp -> build/lib.linux-x86_64-3.9/Cython/Utility
      warning: build_py: byte-compiling is disabled, skipping.

      running build_ext
      building 'Cython.Plex.Scanners' extension
      creating build/temp.linux-x86_64-3.9
      creating build/temp.linux-x86_64-3.9/tmp
      creating build/temp.linux-x86_64-3.9/tmp/pip-install-g6_5_8w6
      creating build/temp.linux-x86_64-3.9/tmp/pip-install-g6_5_8w6/cython
      creating build/temp.linux-x86_64-3.9/tmp/pip-install-g6_5_8w6/cython/Cython
      creating build/temp.linux-x86_64-3.9/tmp/pip-install-g6_5_8w6/cython/Cython/Plex
      x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/include -I/usr/include/python3.9 -c /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c -o build/temp.linux-x86_64-3.9/tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.o
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c: In function ‘__pyx_f_6Cython_4Plex_8Scanners_7Scanner_run_machine_inlined’:
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:3529:11: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       3529 |           __pyx_t_8 = (__pyx_v_data != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_data) != 0);
            |           ^~~~~~~~~
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:3529:11: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       3529 |           __pyx_t_8 = (__pyx_v_data != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_data) != 0);
            |           ^~~~~~~~~
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:3529:11: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       3529 |           __pyx_t_8 = (__pyx_v_data != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_data) != 0);
            |           ^~~~~~~~~
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c: In function ‘__Pyx_modinit_type_init_code’:
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7334:45: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
       7334 |   __pyx_type_6Cython_4Plex_8Scanners_Scanner.tp_print = 0;
            |                                             ^
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c: In function ‘__Pyx_ParseOptionalKeywords’:
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7908:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7908 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                     ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
        580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
            |                                             ^~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:7924:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
       7924 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                         ^
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
        446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
            |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c: In function ‘__Pyx_PyUnicode_Substring’:
      /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:8399:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
       8399 |         return PyUnicode_FromUnicode(NULL, 0);
            |         ^~~~~~
      In file included from /usr/include/python3.9/unicodeobject.h:1026,
                       from /usr/include/python3.9/Python.h:97,
                       from /tmp/pip-install-g6_5_8w6/cython/Cython/Plex/Scanners.c:19:
      /usr/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here
        551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
            |                                          ^~~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g6_5_8w6/cython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g6_5_8w6/cython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-yd42iafn/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-gthfa0j3/overlay --compile --install-headers /home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/include/site/python3.9/cython Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/bin/python /home/amirouche/.local/share/virtualenvs/tmp-kapugSIt/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gthfa0j3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools >= 35.0.2' 'wheel >= 0.29.0' twine 'cython == 0.29.6' Check the logs for full command output.
% 
rgaudin commented 3 years ago

As stated in setup metadata, current version is available for python 3.6, 3.7 and 3.8. We haven't looked at py3.9. This is mostly in Cython's hand so we'll look at upgrading it when we merge the libzim_next branch. Feel free to open a py3.9 support feature request if that's important to you.