[
https://issues.apache.org/jira/browse/TINKERPOP-3116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17892185#comment-17892185
]
ASF GitHub Bot commented on TINKERPOP-3116:
-------------------------------------------
JonZeolla commented on PR #2844:
URL: https://github.com/apache/tinkerpop/pull/2844#issuecomment-2432527555
It seems to be related to the version of python; when using python >= 3.11,
`aiohttp` v3.10.10 does not include `async_timeout` as a transitive dependency.
3.10:
```bash
➜ uv add 'gremlinpython; python_version == "3.10"'
Using CPython 3.10.15
Removed virtual environment at: .venv
Creating virtual environment at: .venv
Resolved 17 packages in 9ms
Installed 16 packages in 15ms
+ aenum==3.1.15
+ aiohappyeyeballs==2.4.3
+ aiohttp==3.10.10
+ aiosignal==1.3.1
+ async-timeout==4.0.3
+ attrs==24.2.0
+ frozenlist==1.5.0
+ gremlinpython==3.7.2
+ idna==3.10
+ isodate==0.7.2
+ multidict==6.1.0
+ nest-asyncio==1.6.0
+ propcache==0.2.0
+ six==1.16.0
+ typing-extensions==4.12.2
+ yarl==1.16.0
➜ uv tree
Resolved 17 packages in 5ms
example v0.1.0
└── gremlinpython v3.7.2
├── aenum v3.1.15
├── aiohttp v3.10.10
│ ├── aiohappyeyeballs v2.4.3
│ ├── aiosignal v1.3.1
│ │ └── frozenlist v1.5.0
│ ├── async-timeout v4.0.3
│ ├── attrs v24.2.0
│ ├── frozenlist v1.5.0
│ ├── multidict v6.1.0
│ │ └── typing-extensions v4.12.2
│ └── yarl v1.16.0
│ ├── idna v3.10
│ ├── multidict v6.1.0 (*)
│ └── propcache v0.2.0
├── isodate v0.7.2
├── nest-asyncio v1.6.0
└── six v1.16.0
(*) Package tree already displayed
```
3.11:
```bash
➜ uv add 'gremlinpython; python_version == "3.11"'
Using CPython 3.11.10
Removed virtual environment at: .venv
Creating virtual environment at: .venv
Resolved 15 packages in 5ms
Prepared 5 packages in 246ms
Installed 14 packages in 20ms
+ aenum==3.1.15
+ aiohappyeyeballs==2.4.3
+ aiohttp==3.10.10
+ aiosignal==1.3.1
+ attrs==24.2.0
+ frozenlist==1.5.0
+ gremlinpython==3.7.2
+ idna==3.10
+ isodate==0.7.2
+ multidict==6.1.0
+ nest-asyncio==1.6.0
+ propcache==0.2.0
+ six==1.16.0
+ yarl==1.16.0
➜ uv tree
Resolved 15 packages in 8ms
example v0.1.0
└── gremlinpython v3.7.2
├── aenum v3.1.15
├── aiohttp v3.10.10
│ ├── aiohappyeyeballs v2.4.3
│ ├── aiosignal v1.3.1
│ │ └── frozenlist v1.5.0
│ ├── attrs v24.2.0
│ ├── frozenlist v1.5.0
│ ├── multidict v6.1.0
│ └── yarl v1.16.0
│ ├── idna v3.10
│ ├── multidict v6.1.0
│ └── propcache v0.2.0
├── isodate v0.7.2
├── nest-asyncio v1.6.0
└── six v1.16.0
```
> async_timeout not declared in gremlinpython dependencies
> --------------------------------------------------------
>
> Key: TINKERPOP-3116
> URL: https://issues.apache.org/jira/browse/TINKERPOP-3116
> Project: TinkerPop
> Issue Type: Bug
> Components: python
> Affects Versions: 3.7.2
> Reporter: Jon Zeolla
> Priority: Minor
>
> `async-timeout` is missing from [the install
> requirements|https://github.com/apache/tinkerpop/blob/49829884a5617ed1a86211e69826c16e549b0600/gremlin-python/src/main/python/setup.py#L47-L52].
> This appears to have been untouched for quite a while; possibly some
> upstream dependency no longer uses `async-timeout`?
> `async-timeout` _is_ installed [in the
> example|https://github.com/apache/tinkerpop/blob/49829884a5617ed1a86211e69826c16e549b0600/gremlin-python/src/main/python/examples/requirements.txt#L21]
> and after I do a fresh install of `gremlinpython` I saw the following:
> ```bash
> ➜ python3
> Python 3.12.6 (main, Sep 9 2024, 21:36:32) [Clang 18.1.8 ] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from gremlin_python.process.anonymous_traversal import traversal
> >>> from gremlin_python.driver.driver_remote_connection import
> >>> DriverRemoteConnection
> >>> g =
> >>> traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin','g'))
> Traceback (most recent call last):
> File
> "/Users/example/tinkerpop/.venv/lib/python3.12/site-packages/gremlin_python/driver/client.py",
> line 70, in __init__
> from gremlin_python.driver.aiohttp.transport import (
> File
> "/Users/example/tinkerpop/.venv/lib/python3.12/site-packages/gremlin_python/driver/aiohttp/transport.py",
> line 21, in <module>
> import async_timeout
> ModuleNotFoundError: No module named 'async_timeout'
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/Users/example/tinkerpop/.venv/lib/python3.12/site-packages/gremlin_python/driver/driver_remote_connection.py",
> line 69, in __init__
> self._client = client.Client(url, traversal_source,
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File
> "/Users/example/tinkerpop/.venv/lib/python3.12/site-packages/gremlin_python/driver/client.py",
> line 73, in __init__
> raise Exception("Please install AIOHTTP or pass "
> ```
> After installing `async-timeout` I now get:
> ```bash
> ➜ python3
> Python 3.12.6 (main, Sep 9 2024, 21:36:32) [Clang 18.1.8 ] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from gremlin_python.process.anonymous_traversal import traversal
> >>> from gremlin_python.driver.driver_remote_connection import
> >>> DriverRemoteConnection
> >>>
> >>> g =
> >>> traversal().with_remote(DriverRemoteConnection('ws://localhost:8182/gremlin',
> >>> 'g'))
> ```
> h2. My environment
> macOS 15.0.1, M2
> Python 3.12.6
> gremlin_python 3.7.2
--
This message was sent by Atlassian Jira
(v8.20.10#820010)