Skip to content

Commit cec268e

Browse files
authored
* Prepare for next developer iteration, 2.4.1. Signed-off-by: dblock <dblock@amazon.com> * Fix: sync opensearchpy without iohttp. Signed-off-by: dblock <dblock@amazon.com> * Use nox to run tests. Signed-off-by: dblock <dblock@amazon.com> --------- Signed-off-by: dblock <dblock@amazon.com>
1 parent 4874437 commit cec268e

File tree

9 files changed

+51
-25
lines changed

9 files changed

+51
-25
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
PIP_DISABLE_PIP_VERSION_CHECK: 1
3232
- name: Install Dependencies
3333
run: |
34-
python -m pip install -r dev-requirements.txt
34+
python -m pip install nox
3535
- name: Run Tests
3636
run: |
37-
python setup.py test
37+
python -m nox -rs test-${{ matrix.entry.python-version }}
3838
- name: Upload coverage to Codecov
3939
uses: codecov/codecov-action@v2
4040
with:

.github/workflows/unified-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
stack_version: ['2.4.0']
12+
stack_version: ['2.4.1']
1313

1414
steps:
1515
- name: Checkout

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# CHANGELOG
22
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
33

4+
## [2.4.1]
5+
### Added
6+
### Changed
7+
### Deprecated
8+
### Removed
9+
### Fixed
10+
- Fix dependency on `aiohttp` ([#594](https://github.com/opensearch-project/opensearch-py/pull/594))
11+
### Security
12+
413
## [2.4.0]
514
### Added
615
- Added generating imports and headers to API generator ([#467](https://github.com/opensearch-project/opensearch-py/pull/467))

RELEASING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ The release process is standard across repositories in this org and is run by a
3737
1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created.
3838
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/).
3939
1. Once the above release workflow is successful, the drafted release on GitHub is published automatically.
40-
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).
40+
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).

benchmarks/poetry.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

noxfile.py

+8
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@
4545
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore
4646
def test(session: Any) -> None:
4747
session.install(".")
48+
# ensure client can be imported without aiohttp
49+
session.run("python", "-c", "import opensearchpy\nprint(opensearchpy.OpenSearch())")
50+
# ensure client can be imported with aiohttp
51+
session.install(".[async]")
52+
session.run(
53+
"python", "-c", "import opensearchpy\nprint(opensearchpy.AsyncOpenSearch())"
54+
)
55+
4856
session.install("-r", "dev-requirements.txt")
4957

5058
session.run("python", "setup.py", "test")

opensearchpy/__init__.py

+19-17
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,8 @@
4444
logger = logging.getLogger("opensearch")
4545
logger.addHandler(logging.NullHandler())
4646

47-
from ._async.client import AsyncOpenSearch
48-
from ._async.http_aiohttp import AIOHttpConnection, AsyncConnection
49-
from ._async.transport import AsyncTransport
5047
from .client import OpenSearch
5148
from .connection import (
52-
AsyncHttpConnection,
5349
Connection,
5450
RequestsHttpConnection,
5551
Urllib3HttpConnection,
@@ -76,12 +72,7 @@
7672
UnknownDslObject,
7773
ValidationException,
7874
)
79-
from .helpers import (
80-
AWSV4SignerAsyncAuth,
81-
AWSV4SignerAuth,
82-
RequestsAWSV4SignerAuth,
83-
Urllib3AWSV4SignerAuth,
84-
)
75+
from .helpers import AWSV4SignerAuth, RequestsAWSV4SignerAuth, Urllib3AWSV4SignerAuth
8576
from .helpers.aggs import A
8677
from .helpers.analysis import analyzer, char_filter, normalizer, token_filter, tokenizer
8778
from .helpers.document import Document, InnerDoc, MetaField
@@ -159,7 +150,6 @@
159150
"JSONSerializer",
160151
"Connection",
161152
"RequestsHttpConnection",
162-
"AsyncHttpConnection",
163153
"Urllib3HttpConnection",
164154
"ImproperlyConfigured",
165155
"OpenSearchException",
@@ -178,7 +168,6 @@
178168
"AWSV4SignerAuth",
179169
"Urllib3AWSV4SignerAuth",
180170
"RequestsAWSV4SignerAuth",
181-
"AWSV4SignerAsyncAuth",
182171
"A",
183172
"AttrDict",
184173
"AttrList",
@@ -251,10 +240,23 @@
251240
"normalizer",
252241
"token_filter",
253242
"tokenizer",
254-
"AIOHttpConnection",
255-
"AsyncConnection",
256-
"AsyncTransport",
257-
"AsyncOpenSearch",
258-
"AsyncHttpConnection",
259243
"__versionstr__",
260244
]
245+
246+
try:
247+
from ._async.client import AsyncOpenSearch
248+
from ._async.http_aiohttp import AIOHttpConnection, AsyncConnection
249+
from ._async.transport import AsyncTransport
250+
from .connection import AsyncHttpConnection
251+
from .helpers import AWSV4SignerAsyncAuth
252+
253+
__all__ += [
254+
"AIOHttpConnection",
255+
"AsyncConnection",
256+
"AsyncTransport",
257+
"AsyncOpenSearch",
258+
"AsyncHttpConnection",
259+
"AWSV4SignerAsyncAuth",
260+
]
261+
except (ImportError, SyntaxError):
262+
pass

opensearchpy/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
# specific language governing permissions and limitations
2626
# under the License.
2727

28-
__versionstr__: str = "2.4.0"
28+
__versionstr__: str = "2.4.1"

opensearchpy/connection/__init__.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
from .base import Connection
30-
from .http_async import AsyncHttpConnection
3130
from .http_requests import RequestsHttpConnection
3231
from .http_urllib3 import Urllib3HttpConnection, create_ssl_context
3332

@@ -36,5 +35,13 @@
3635
"RequestsHttpConnection",
3736
"Urllib3HttpConnection",
3837
"create_ssl_context",
39-
"AsyncHttpConnection",
4038
]
39+
40+
try:
41+
from .http_async import AsyncHttpConnection
42+
43+
__all__ += [
44+
"AsyncHttpConnection",
45+
]
46+
except (ImportError, SyntaxError):
47+
pass

0 commit comments

Comments
 (0)