python-psycopg2 fails to build with Python 3.13.0a1. psycopg/connection_int.c:395:14: error: implicit declaration of function ‘isalnum’ [-Werror=implicit-function-declaration] 395 | if (!isalnum(*i)) { | ^~~~~~~ psycopg/connection_int.c:35:1: note: include ‘<ctype.h>’ or provide a declaration of ‘isalnum’ 34 | #include "psycopg/notify.h" +++ |+#include <ctype.h> 35 | psycopg/connection_int.c:399:20: error: implicit declaration of function ‘toupper’ [-Werror=implicit-function-declaration] 399 | *j++ = toupper(*i++); | ^~~~~~~ https://docs.python.org/3.13/whatsnew/3.13.html For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06551100-python-psycopg2/ For all our attempts to build python-psycopg2 with Python 3.13, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-psycopg2/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.13: https://copr.fedorainfracloud.org/coprs/g/python/python3.13/ Let us know here if you have any questions. Python 3.13 is planned to be included in Fedora 41. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle. Changing version to 40.
The failure is different now with alpha6: psycopg/utils.c: In function ‘psyco_is_main_interp’: psycopg/utils.c:397:12: error: implicit declaration of function ‘_PyInterpreterState_Get’; did you mean ‘PyInterpreterState_Get’? [-Wimplicit-function-declaration] 397 | return _PyInterpreterState_Get() == PyInterpreterState_Main(); | ^~~~~~~~~~~~~~~~~~~~~~~ | PyInterpreterState_Get psycopg/utils.c:397:38: warning: comparison between pointer and integer 397 | return _PyInterpreterState_Get() == PyInterpreterState_Main(); | ^~ error: command '/usr/bin/gcc' failed with exit code 1
After a naive sed removing the underscore two tests fail: ====================================================================== FAIL: test_cidr_adapt (tests.test_ipaddress.NetworkingTestCase.test_cidr_adapt) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/psycopg2-2.9.9/tests/test_ipaddress.py", line 112, in test_cidr_adapt self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '::ffff:1.2.3.0/128' != '::ffff:102:300/128' - ::ffff:1.2.3.0/128 ? ^ ^ ^ + ::ffff:102:300/128 ? ^ ^ ^ ====================================================================== FAIL: test_inet_adapt (tests.test_ipaddress.NetworkingTestCase.test_inet_adapt) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/psycopg2-2.9.9/tests/test_ipaddress.py", line 71, in test_inet_adapt self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: '::ffff:1.2.3.0/128' != '::ffff:102:300/128' - ::ffff:1.2.3.0/128 ? ^ ^ ^ + ::ffff:102:300/128 ? ^ ^ ^ ---------------------------------------------------------------------- Ran 742 tests in 20.673s
Upstream PR: https://github.com/psycopg/psycopg2/pull/1695