* Fixed utils/build-dists.py which was broken by 49ae7c7
Previously the async helpers imported AsyncOpenSearch and therefore failed to import anytime it did
Signed-off-by: Roger Aiudi <aiudirog@gmail.com>
* Refactor async helpers try block to a simple if statement
Signed-off-by: Roger Aiudi <aiudirog@gmail.com>
* Remove newline to pass black
Signed-off-by: Roger Aiudi <aiudirog@gmail.com>
---------
Signed-off-by: Roger Aiudi <aiudirog@gmail.com>
This commit is contained in:
@@ -57,11 +57,8 @@ __all__ = [
|
||||
]
|
||||
|
||||
|
||||
try:
|
||||
# Asyncio only supported on Python 3.6+
|
||||
if sys.version_info < (3, 6):
|
||||
raise ImportError
|
||||
|
||||
# Asyncio only supported on Python 3.6+
|
||||
if sys.version_info >= (3, 6):
|
||||
from .._async.helpers import (
|
||||
async_bulk,
|
||||
async_reindex,
|
||||
@@ -70,5 +67,3 @@ try:
|
||||
)
|
||||
|
||||
__all__ += ["async_scan", "async_bulk", "async_reindex", "async_streaming_bulk"]
|
||||
except (ImportError, SyntaxError):
|
||||
pass
|
||||
|
||||
@@ -105,11 +105,12 @@ def test_dist(dist):
|
||||
f"from {dist_name} import AsyncOpenSearch",
|
||||
expect_exit_code=256,
|
||||
)
|
||||
|
||||
# Ensure async helpers are available regardless of aiohttp installation
|
||||
run(
|
||||
venv_python,
|
||||
"-c",
|
||||
f"from {dist_name}.helpers import async_scan, async_bulk, async_streaming_bulk, async_reindex",
|
||||
expect_exit_code=256,
|
||||
)
|
||||
|
||||
# Install aiohttp and see that async is now available
|
||||
|
||||
Reference in New Issue
Block a user