Azure / azure-uamqp-python

AMQP 1.0 client library for Python
MIT License
56 stars 47 forks source link

Fails to build with Python 3.13 #399

Closed stefanor closed 1 month ago

stefanor commented 2 months ago

Describe the bug

aarch64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -g -O2 -Werror
=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -
fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -Wno-err
or=deprecated-declarations -Wno-error=incompatible-pointer-types -Wdate-time -D_FORTIFY_SOURCE
=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./src/vendor/inc -I./src/vendor/azure-uamqp-c/deps/
azure-macro-utils-c/inc -I./src/vendor/azure-uamqp-c/deps/umock-c/inc -I./src/vendor/azure-uam
qp-c/deps/azure-c-shared-utility/pal/inc -I./src/vendor/azure-uamqp-c/deps/azure-c-shared-util
ity/inc -I./src/vendor/azure-uamqp-c/inc -I./src/vendor/azure-uamqp-c/deps/azure-c-shared-util
ity/pal/linux -I/usr/include/python3.13 -c uamqp/c_uamqp.c -o build/temp.linux-aarch64-cpython
-313/uamqp/c_uamqp.o -g -O0 -std=gnu99 -fPIC
uamqp/c_uamqp.c:942:1: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
  942 | static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
      | ^~~~~~
uamqp/c_uamqp.c: In function ‘__Pyx_Py_UNICODE_strlen’:
uamqp/c_uamqp.c:943:5: warning: ‘Py_UNICODE’ is deprecated [-Wdeprecated-declarations]
  943 |     const Py_UNICODE *u_end = u;
      |     ^~~~~
uamqp/c_uamqp.c: In function ‘__Pyx_init_assertions_enabled’:
uamqp/c_uamqp.c:3165:39: error: implicit declaration of function ‘_PyInterpreterState_GetConfig’; did you mean ‘PyInterpreterState_GetID’? [-Wimplicit-function-declaration]
 3165 |     __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       PyInterpreterState_GetID
uamqp/c_uamqp.c:3165:105: error: invalid type argument of ‘->’ (have ‘int’)
 3165 |     __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
      |                                                                                                         ^~

To Reproduce Steps to reproduce the behavior:

  1. Build on Python 3.13
kashifkhan commented 2 months ago

Hi @stefanor, the wheels currently are built for py3.12. We plan on releasing support for py3.13

kashifkhan commented 2 months ago

@stefanor quick question are you using uAMQP for Servicebus or Eventhub, because you should be using the new python based version. Otherwise in what context is it being used ?

stefanor commented 2 months ago

I'm not using it, personally. The context is Debian unstable, where it is a Build-Dependency of python-azure. Debian bug

stefanb2 commented 1 month ago

This also affects upcoming Fedora 41 stable which has Python 3.13 stable as default.

@kashifkhan Python 3.13 stable has been released already. When can we expect your release?

kashifkhan commented 1 month ago

@stefanb2 @stefanb2 Im working on getting a release out for wheels with py313 support. Just a few more tests to finish out and Ill update this thread when its on pypi.

stefanb2 commented 1 month ago

@kashifkhan thanks, good to know.

FYI: Fedora 41 Final is GO and will be shipped on Tuesday 29th October 2024.

kashifkhan commented 1 month ago

@stefanb2 @stefanor uamqp 1.6.11 is now available on pypi

stefanb2 commented 1 month ago

I can confirm that the new version installs and works with Python 3.13.

NOTE: Azure CLI extension aziot-iot does not automatically detect that it needs to update its own installation of uamqp. I used the following steps to work around this problem on my Fedora 41 Linux installation:

$ cd ${HOME}/.azure/cliextensions/azure-iot
$ mkdir uamqp-python-3.12
$ mv uamqp* uamqp-python-3.12/

# now any IoT command that uses uamqp will trigger re-installation of the dependency for Python 3.13, e.g.
$ az iot hub monitor-events --subscription ... --hub-name ...

This also means that you can't have parallel virtual environments with azure-cli for different Python versions, because the extension dependency directory is global, not per virtual environment.