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

fails to build with Python 3.13 #1181

Open
Cikmo opened this issue Sep 15, 2024 · 5 comments
Open

fails to build with Python 3.13 #1181

Cikmo opened this issue Sep 15, 2024 · 5 comments

Comments

@Cikmo
Copy link

Cikmo commented Sep 15, 2024

  • asyncpg version: 0.29.0
  • Python version: 3.13.0rc2
  • Platform: Linux
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?: n/a
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : yes

Fails to build on Python 3.13. There's been various API changes.

      asyncpg/pgproto/pgproto.c:23886:18: warning: ‘__pyx_f_7asyncpg_7pgproto_7pgproto_json_encode’ defined but not used [-Wunused-function]
      23886 | static PyObject *__pyx_f_7asyncpg_7pgproto_7pgproto_json_encode(struct __pyx_obj_7asyncpg_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_7asyncpg_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
            |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/username/.pyenv/versions/3.13.0rc2/include/python3.13/cpython/longobject.h:111:17: note: declared here
        111 | PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
            |                 ^~~~~~~~~~~~~~~~~~~

Read more: MagicStack/uvloop#603

@musicinmybrain
Copy link
Contributor

musicinmybrain commented Sep 28, 2024

If it helps, we’re successfully building and testing asyncpg with Python 3.13 in Fedora using the following adaptations:

And, of course, we remove any pre-generated Cythonized C sources and re-generate them with a current Cython (3.0.11):

# Remove pre-generated C sources from Cython to ensure they are re-generated
# and not used in the build. Note that recordobj.c is not a generated source,
# and must not be removed!
find asyncpg -type f -name '*.c' ! -name 'recordobj.c' -print -delete

(We also export the environment variable ASYNCPG_BUILD_CYTHON_ALWAYS=1, which might not be necessary once we’ve removed any pre-generated Cythonized C sources.)

@kamikaze
Copy link

same issue here

@sylvainmouquet
Copy link

sylvainmouquet commented Oct 11, 2024

same error but when i set the github repository, it works with python versions 3.9, 3.10, 3.11, 3.12 and 3.13:

[tool.uv.sources]
asyncpg = { git = "https://github.com/MagicStack/asyncpg"}

When the next release is planned ?

@juergenzimmermann
Copy link

pip install ... also fails on a Windows box. The output is attached.
windows-python-3.13..txt

@Kwieeciol
Copy link

same issue on Mac

ERROR: Failed building wheel for asyncpg
Failed to build asyncpg
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (asyncpg)

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

6 participants