Fix for 592 (#594)

* Prepare for next developer iteration, 2.4.1.

Signed-off-by: dblock <[email protected]>

* Fix: sync opensearchpy without iohttp.

Signed-off-by: dblock <[email protected]>

* Use nox to run tests.

Signed-off-by: dblock <[email protected]>

---------

Signed-off-by: dblock <[email protected]>
This commit is contained in:
Daniel (dB.) Doubrovkine
2023-11-15 16:33:43 -08:00
committed by GitHub
parent 4874437fb5
commit cec268e48d
9 changed files with 51 additions and 25 deletions
+2 -2
View File
@@ -31,10 +31,10 @@ jobs:
PIP_DISABLE_PIP_VERSION_CHECK: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1
- name: Install Dependencies - name: Install Dependencies
run: | run: |
python -m pip install -r dev-requirements.txt python -m pip install nox
- name: Run Tests - name: Run Tests
run: | run: |
python setup.py test python -m nox -rs test-${{ matrix.entry.python-version }}
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v2 uses: codecov/codecov-action@v2
with: with:
+1 -1
View File
@@ -9,7 +9,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
stack_version: ['2.4.0'] stack_version: ['2.4.1']
steps: steps:
- name: Checkout - name: Checkout
+9
View File
@@ -1,6 +1,15 @@
# CHANGELOG # CHANGELOG
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [2.4.1]
### Added
### Changed
### Deprecated
### Removed
### Fixed
- Fix dependency on `aiohttp` ([#594](https://github.com/opensearch-project/opensearch-py/pull/594))
### Security
## [2.4.0] ## [2.4.0]
### Added ### Added
- Added generating imports and headers to API generator ([#467](https://github.com/opensearch-project/opensearch-py/pull/467)) - Added generating imports and headers to API generator ([#467](https://github.com/opensearch-project/opensearch-py/pull/467))
+1 -1
View File
@@ -37,4 +37,4 @@ The release process is standard across repositories in this org and is run by a
1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created. 1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created.
1. This draft release triggers the [jenkins release workflow](https://build.ci.opensearch.org/job/opensearch-py-release/) as a result of which opensearch-py client is released on [PyPi](https://pypi.org/project/opensearch-py/). 1. This draft release triggers the [jenkins release workflow](https://build.ci.opensearch.org/job/opensearch-py-release/) as a result of which opensearch-py client is released on [PyPi](https://pypi.org/project/opensearch-py/).
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically. 1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
1. Increment "version" in [_version.py](./opensearchpy/_version.py) to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-py/pull/167). 1. Add an "Unreleased" section to CHANGELOG, and increment version to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-py/pull/593).
+1 -1
View File
@@ -515,7 +515,7 @@ files = [
[[package]] [[package]]
name = "opensearch-py" name = "opensearch-py"
version = "2.4.0" version = "2.4.1"
description = "Python client for OpenSearch" description = "Python client for OpenSearch"
optional = false optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4"
+8
View File
@@ -45,6 +45,14 @@ SOURCE_FILES = (
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore @nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore
def test(session: Any) -> None: def test(session: Any) -> None:
session.install(".") session.install(".")
# ensure client can be imported without aiohttp
session.run("python", "-c", "import opensearchpy\nprint(opensearchpy.OpenSearch())")
# ensure client can be imported with aiohttp
session.install(".[async]")
session.run(
"python", "-c", "import opensearchpy\nprint(opensearchpy.AsyncOpenSearch())"
)
session.install("-r", "dev-requirements.txt") session.install("-r", "dev-requirements.txt")
session.run("python", "setup.py", "test") session.run("python", "setup.py", "test")
+16 -14
View File
@@ -44,12 +44,8 @@ VERSION = __version__ = (_major, _minor, _patch)
logger = logging.getLogger("opensearch") logger = logging.getLogger("opensearch")
logger.addHandler(logging.NullHandler()) logger.addHandler(logging.NullHandler())
from ._async.client import AsyncOpenSearch
from ._async.http_aiohttp import AIOHttpConnection, AsyncConnection
from ._async.transport import AsyncTransport
from .client import OpenSearch from .client import OpenSearch
from .connection import ( from .connection import (
AsyncHttpConnection,
Connection, Connection,
RequestsHttpConnection, RequestsHttpConnection,
Urllib3HttpConnection, Urllib3HttpConnection,
@@ -76,12 +72,7 @@ from .exceptions import (
UnknownDslObject, UnknownDslObject,
ValidationException, ValidationException,
) )
from .helpers import ( from .helpers import AWSV4SignerAuth, RequestsAWSV4SignerAuth, Urllib3AWSV4SignerAuth
AWSV4SignerAsyncAuth,
AWSV4SignerAuth,
RequestsAWSV4SignerAuth,
Urllib3AWSV4SignerAuth,
)
from .helpers.aggs import A from .helpers.aggs import A
from .helpers.analysis import analyzer, char_filter, normalizer, token_filter, tokenizer from .helpers.analysis import analyzer, char_filter, normalizer, token_filter, tokenizer
from .helpers.document import Document, InnerDoc, MetaField from .helpers.document import Document, InnerDoc, MetaField
@@ -159,7 +150,6 @@ __all__ = [
"JSONSerializer", "JSONSerializer",
"Connection", "Connection",
"RequestsHttpConnection", "RequestsHttpConnection",
"AsyncHttpConnection",
"Urllib3HttpConnection", "Urllib3HttpConnection",
"ImproperlyConfigured", "ImproperlyConfigured",
"OpenSearchException", "OpenSearchException",
@@ -178,7 +168,6 @@ __all__ = [
"AWSV4SignerAuth", "AWSV4SignerAuth",
"Urllib3AWSV4SignerAuth", "Urllib3AWSV4SignerAuth",
"RequestsAWSV4SignerAuth", "RequestsAWSV4SignerAuth",
"AWSV4SignerAsyncAuth",
"A", "A",
"AttrDict", "AttrDict",
"AttrList", "AttrList",
@@ -251,10 +240,23 @@ __all__ = [
"normalizer", "normalizer",
"token_filter", "token_filter",
"tokenizer", "tokenizer",
"__versionstr__",
]
try:
from ._async.client import AsyncOpenSearch
from ._async.http_aiohttp import AIOHttpConnection, AsyncConnection
from ._async.transport import AsyncTransport
from .connection import AsyncHttpConnection
from .helpers import AWSV4SignerAsyncAuth
__all__ += [
"AIOHttpConnection", "AIOHttpConnection",
"AsyncConnection", "AsyncConnection",
"AsyncTransport", "AsyncTransport",
"AsyncOpenSearch", "AsyncOpenSearch",
"AsyncHttpConnection", "AsyncHttpConnection",
"__versionstr__", "AWSV4SignerAsyncAuth",
] ]
except (ImportError, SyntaxError):
pass
+1 -1
View File
@@ -25,4 +25,4 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
__versionstr__: str = "2.4.0" __versionstr__: str = "2.4.1"
+9 -2
View File
@@ -27,7 +27,6 @@
from .base import Connection from .base import Connection
from .http_async import AsyncHttpConnection
from .http_requests import RequestsHttpConnection from .http_requests import RequestsHttpConnection
from .http_urllib3 import Urllib3HttpConnection, create_ssl_context from .http_urllib3 import Urllib3HttpConnection, create_ssl_context
@@ -36,5 +35,13 @@ __all__ = [
"RequestsHttpConnection", "RequestsHttpConnection",
"Urllib3HttpConnection", "Urllib3HttpConnection",
"create_ssl_context", "create_ssl_context",
"AsyncHttpConnection",
] ]
try:
from .http_async import AsyncHttpConnection
__all__ += [
"AsyncHttpConnection",
]
except (ImportError, SyntaxError):
pass