Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to install from PyPI on Python 3.13 #95

Open
PhilippWendler opened this issue Oct 10, 2024 · 0 comments
Open

Failure to install from PyPI on Python 3.13 #95

PhilippWendler opened this issue Oct 10, 2024 · 0 comments

Comments

@PhilippWendler
Copy link

If I attempt to pip install pystemd on Python 3.13, it attempts to install 0.13.2 but fails with the following error:

[...]
      building 'pystemd.cutils' extension
      creating build/temp.linux-x86_64-cpython-313/pystemd
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/usr/local/include/python3.13 -c pystemd/cutils.c -o build/temp.linux-x86_64-cpython-313/pystemd/cutils.o
      pystemd/cutils.c:850:1: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
        850 | static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
            | ^~~~~~
      pystemd/cutils.c: In function ‘__Pyx_Py_UNICODE_strlen’:
      pystemd/cutils.c:851:5: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
        851 |     const Py_UNICODE *u_end = u;
            |     ^~~~~
      pystemd/cutils.c: In function ‘__Pyx_PyInt_As_int’:
      pystemd/cutils.c:2379:27: error: too few arguments to function ‘_PyLong_AsByteArray’
       2379 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      In file included from /usr/local/include/python3.13/longobject.h:107,
                       from /usr/local/include/python3.13/Python.h:81,
                       from pystemd/cutils.c:22:
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      pystemd/cutils.c: In function ‘__Pyx_PyInt_As_long’:
      pystemd/cutils.c:2651:27: error: too few arguments to function ‘_PyLong_AsByteArray’
       2651 |                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
            |                           ^~~~~~~~~~~~~~~~~~~
      /usr/local/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1

(Full reproducer podman run --rm -it python:3.13 bash -c 'apt-get update && apt-get install libsystemd-dev && pip install pystemd')

If I install from GitHub with pip install git+https://github.com/systemd/pystemd it works. I believe this is not due to 0.13.2 being older than 5cdee54 but because the .tar.gz on PyPI includes the file pystemd/cutils.c, which is auto-generated by Cython but in this version is incompatible with Python 3.13. The GitHub repo does not contain cutils.c, so I assume it is generated during build in a matching version.

I have no experience with C extensions for Python and do not know whether it is intended that the archive on Python contains the generated C files. But could you please upload a version to PyPI that is installable on Python 3.13? I suspect either the generated C code needs to be updated or removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant