MagicStack/asyncpg

Python 3.13 compatibility

Closed this issue · 4 comments

  • asyncpg version:
  • PostgreSQL version:
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version:
  • Platform:
  • Do you use pgbouncer?:
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    :

The following fails:

python3.13 -m venv venv && source venv/bin/activate
pip install -U pip && pip install asyncdb

Error is:

        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Compiler/ExprNodes.py", line 4946, in SliceIndexNode
          get_slice_utility_code = TempitaUtilityCode.load(
              "SliceObject", "ObjectHandling.c", context={'access': 'Get'})
        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Compiler/Code.py", line 404, in load
          return cls(**kwargs)
        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Compiler/Code.py", line 649, in __init__
          proto = sub_tempita(proto, context, file, name)
        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Compiler/Code.py", line 641, in sub_tempita
          from ..Tempita import sub
        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Tempita/__init__.py", line 4, in <module>
          from ._tempita import *
        File "/private/var/folders/sx/slyqb94j7533_qcdhwzr_rm80000gn/T/pip-build-env-1ommkovk/overlay/lib/python3.13/site-packages/Cython/Tempita/_tempita.py", line 36, in <module>
          import cgi
      ModuleNotFoundError: No module named 'cgi'
      [end of output]

According to Python 3.13 release notes, module cgi was removed in 3.13

You're trying to install asyncdb, this repository is for asyncpg, which is a different library and supports Python 3.13 just fine.

OMG - sorry about the false alarm - my bad.

Haha --- well, turns out I actually meant asyncpg not asyncdb in the report --- and indeed I was getting a problem on 3.13 with installing asyncpg==0.29.0 but that seems to have been resolved in 0.30.0 -- so all is good. Apologies again.