aio-libs / aio-libs/aiosparql

aiosparql is incompatible with python11 and above

未关闭
#103 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
24
派生
10
PR 合并指标
30 天内没有已合并 PR

描述

Hi, i'm trying to use aiosparql in python3.13. I believe the library is incompatible with python3.13 (or any version >= 3.11) because it makes use of `@asyncio.coroutine` which was removed in python3.11

Here is a minimal example to reproduce the error. Please run in python3.13 to reproduce. I believe it should fail in any version >= 3.11 but I have only tested in 3.13
```python
import asyncio
from aiosparql.client import SPARQLClient

async def main():
client = SPARQLClient(service)
query = """
PREFIX dbo:
SELECT COUNT(DISTINCT(?s)) AS ?count
WHERE {
?s a dbo:Drug .
}
"""

result = await client.query(query)
print(result)

asyncio.run(main())
```

I get the error
```
experiments/test_graph_db_perf.py:4: in
from common import misc, rdfutils
backend/common/rdfutils.py:8: in
from aiosparql.client import SPARQLClient
venv/lib/python3.13/site-packages/aiosparql/client.py:91: in
class SPARQLClient:
venv/lib/python3.13/site-packages/aiosparql/client.py:259: in SPARQLClient
@asyncio.coroutine
E AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
```

Here is a link to documentation saying `@asyncio.coroutine` is removed
https://docs.python.org/3.11/whatsnew/3.11.html#removed
> Removed the @asyncio.coroutine() [decorator](https://docs.python.org/3.11/glossary.html#term-decorator) enabling legacy generator-based coroutines to be compatible with [async](https://docs.python.org/3.11/reference/compound_stmts.html#async) / [await](https://docs.python.org/3.11/reference/expressions.html#await) code. The function has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10. Use [async def](https://docs.python.org/3.11/reference/compound_stmts.html#async-def) instead. (Contributed by Illia Volochii in [bpo-43216](https://bugs.python.org/issue?@action=redirect&bpo=43216).)

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。