ParallelSSH / ssh-python

Python bindings for libssh C library.
https://parallel-ssh.org
GNU Lesser General Public License v2.1
38 stars 27 forks source link

Python 3.11 support #57

Closed eclipse95 closed 2 years ago

eclipse95 commented 2 years ago

Hi, The build of ssh-python fails with Python 3.11. On the Docker image python:3.11-buster with libpython3-dev and cmake packages, I obtained this error:

      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I./local/include -I./libssh/include -I/builds/xxjFYZX3/0/.tox/pylint/include -I/usr/local/include/python3.11 -c ssh/channel.c -o build/temp.linux-x86_64-cpython-311/ssh/channel.o -O3 -g0 -s
      ssh/channel.c: In function ‘__Pyx_AddTraceback’:
      ssh/channel.c:438:62: error: dereferencing pointer to incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
         #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
                                                                    ^~
      ssh/channel.c:9686:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
           __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1

This error seem to be linked to https://github.com/numpy/numpy/issues/21422

enkore commented 2 years ago

3f838cb5ba8a40b5316d7791b59afc922f934914 fixed this in git. The next release will have 3.11 wheels as well. I suggest building from the main branch (pip install git+https://github.com/ParallelSSH/ssh-python.git) instead of a tagged version in the meantime.

irvinren commented 2 years ago

windows failed! Do I need to post the error message?