Skip to content

Commit

Permalink
fix: support conn_pool ping before init | add missing dep in py3.6 (#339
Browse files Browse the repository at this point in the history
)

* fix: support conn_pool ping before init

* fix: missing dep in python3.6

httpcore-->anyio-->contextvars when it's < python3.7
Whoile this was not properly handled by setup.py

Thus this failed, somehow it rollback to .local cache
in ci runner.

* fix: make python3.7+ for setup.py happy
  • Loading branch information
wey-gu authored Apr 25, 2024
1 parent 57354e1 commit 0803838
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
3 changes: 3 additions & 0 deletions nebula3/gclient/net/ConnectionPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def ping(self, address):
"""
try:
conn = Connection()
# support ping before self.init()
if self._configs is None:
self._configs = Config()
conn.open_SSL(
address[0],
address[1],
Expand Down
2 changes: 2 additions & 0 deletions nebula3/gclient/net/SessionPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def init(self, configs=None):
configs, SessionPoolConfig
), 'wrong type of SessionPoolConfig, try this: `from nebula3.Config import SessionPoolConfig`'
self._configs = configs
else:
self._configs = SessionPoolConfig()
# check configs
try:
self._check_configs()
Expand Down
44 changes: 25 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,38 @@
#
# This source code is licensed under Apache 2.0 License.


import sys
from setuptools import setup, find_packages
from pathlib import Path

base_dir = Path(__file__).parent
long_description = (base_dir / 'README.md').read_text()
long_description = (base_dir / "README.md").read_text()

requirements = [
"httplib2 >= 0.20.0",
"future >= 0.18.0",
"six >= 1.16.0",
"pytz >= 2021.1",
"httpx[http2] >= 0.22.0",
]

if sys.version_info < (3, 7):
# httpcore-->anyio-->contextvars when it's < 3.7
# while setuptools doesn't handle the dependency well
requirements.append("contextvars==2.4")

setup(
name='nebula3-python',
version='3.8.0',
license='Apache 2.0',
author='vesoft-inc',
author_email='[email protected]',
description='Python client for NebulaGraph V3.4',
name="nebula3-python",
version="3.8.0",
license="Apache 2.0",
author="vesoft-inc",
author_email="[email protected]",
description="Python client for NebulaGraph V3.4",
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/vesoft-inc/nebula-python',
install_requires=[
'httplib2 >= 0.20.0',
'future >= 0.18.0',
'six >= 1.16.0',
'pytz >= 2021.1',
'httpx[http2] >= 0.22.0',
],
long_description_content_type="text/markdown",
url="https://github.com/vesoft-inc/nebula-python",
install_requires=requirements,
packages=find_packages(),
platforms=['3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12'],
package_dir={'nebula3': 'nebula3'},
platforms=["3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12"],
package_dir={"nebula3": "nebula3"},
)

0 comments on commit 0803838

Please sign in to comment.