Skip to content

Commit

Permalink
Integrate elastic-transport-python library
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson authored Oct 18, 2021
1 parent 5901739 commit 6462574
Show file tree
Hide file tree
Showing 210 changed files with 4,131 additions and 6,969 deletions.
2 changes: 1 addition & 1 deletion .ci/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export STACK_VERSION="${STACK_VERSION:=8.0.0-SNAPSHOT}"
export TEST_SUITE="${TEST_SUITE:=platinum}"
export PYTHON_VERSION="${PYTHON_VERSION:=3.9}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=urllib3}"

script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
Expand Down
5 changes: 3 additions & 2 deletions .ci/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ PYTHON_VERSION:
- "3.7"
- "3.8"
- "3.9"
- "3.10"

PYTHON_CONNECTION_CLASS:
- Urllib3HttpConnection
- RequestsHttpConnection
- urllib3
- requests

exclude: ~
27 changes: 11 additions & 16 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
git+https://github.com/elastic/elastic-transport-python

requests>=2, <3
aiohttp
pytest
pytest-cov
pytest-asyncio
coverage
mock
sphinx
jinja2
python-dateutil

# Testing the 'search_mvt' API response
mapbox-vector-tile
unasync
pyyaml>=5.4
isort
black
twine

# No wheels for Python 3.10 yet!
numpy; python_version<"3.10"
pandas; python_version<"3.10"

# PyYAML 5.3 dropped support for Python 3.4 while
# not amending that requirement to the package. :(
pyyaml>=5.4; python_version>="3.6"
pyyaml<5.3; python_version<"3.6"

isort
black; python_version>="3.6"
twine

# Requirements for testing [async] extra
aiohttp; python_version>="3.6"
pytest-asyncio; python_version>="3.6"
unasync; python_version>="3.6"
# Testing the 'search_mvt' API response
mapbox-vector-tile; python_version<"3.10"
33 changes: 8 additions & 25 deletions elasticsearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,21 @@

import logging
import re
import sys
import warnings

from ._version import __versionstr__

_major, _minor, _patch = (
int(x) for x in re.search(r"^(\d+)\.(\d+)\.(\d+)", __versionstr__).groups()
)
_version_groups = re.search(r"^(\d+)\.(\d+)\.(\d+)", __versionstr__).groups() # type: ignore
_major, _minor, _patch = (int(x) for x in _version_groups)
VERSION = __version__ = (_major, _minor, _patch)

logger = logging.getLogger("elasticsearch")
logger.addHandler(logging.NullHandler())

from ._async.client import AsyncElasticsearch
from ._sync.client import Elasticsearch
from .connection import (
AIOHttpConnection,
AsyncConnection,
Connection,
RequestsHttpConnection,
Urllib3HttpConnection,
)
from .connection_pool import ConnectionPool, ConnectionSelector, RoundRobinSelector
from .exceptions import (
ApiError,
AuthenticationException,
AuthorizationException,
ConflictError,
Expand All @@ -51,32 +42,24 @@
ElasticsearchDeprecationWarning,
ElasticsearchException,
ElasticsearchWarning,
ImproperlyConfigured,
NotFoundError,
RequestError,
SerializationError,
SSLError,
TransportError,
UnsupportedProductError,
)
from .serializer import JSONSerializer
from .transport import AsyncTransport, Transport
from .serializer import JSONSerializer, JsonSerializer

# Only raise one warning per deprecation message so as not
# to spam up the user if the same action is done multiple times.
warnings.simplefilter("default", category=ElasticsearchDeprecationWarning, append=True)
warnings.simplefilter("default", category=ElasticsearchWarning, append=True)

__all__ = [
"ApiError",
"AsyncElasticsearch",
"Elasticsearch",
"Transport",
"ConnectionPool",
"ConnectionSelector",
"RoundRobinSelector",
"JSONSerializer",
"Connection",
"RequestsHttpConnection",
"Urllib3HttpConnection",
"ImproperlyConfigured",
"JsonSerializer",
"ElasticsearchException",
"SerializationError",
"TransportError",
Expand Down
53 changes: 0 additions & 53 deletions elasticsearch/__init__.pyi

This file was deleted.

43 changes: 0 additions & 43 deletions elasticsearch/_async/_extra_imports.py

This file was deleted.

Loading

0 comments on commit 6462574

Please sign in to comment.