From b57b9636c2004f4b0ea1dc4d545bf3f5ab7c82ae Mon Sep 17 00:00:00 2001 From: Ivan Daschinsky Date: Wed, 9 Nov 2022 17:03:13 +0300 Subject: [PATCH 1/7] Prepare 0.6.0 release --- README.md | 8 ++++---- pyignite/__init__.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index be5fa7b..e755498 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Apache Ignite thin (binary protocol) client, written in Python 3. ## Prerequisites -- Python 3.7 or above (3.7, 3.8, 3.9 and 3.10 are tested), +- Python 3.7 or above (3.7, 3.8, 3.9, 3.10 and 3.11 are tested), - Access to Apache Ignite node, local or remote. The current thin client - version was tested on Apache Ignite 2.10 (binary client protocol 1.7.0). + version was tested on Apache Ignite 2.14 (binary client protocol 1.7.0). ## Installation @@ -45,7 +45,7 @@ There is an optional C extension to speedup some computational intensive tasks. ***NB!* Docker is required.** -- On Windows MSVC 14.x required, and it should be in path, also python versions 3.7, 3.8, 3.9 and 3.10 both for x86 and +- On Windows MSVC 14.x required, and it should be in path, also python versions 3.7, 3.8, 3.9, 3.10 and 3.11 both for x86 and x86-64 should be installed. You can disable some of these versions but you'd need to edit script for that. - For building `wheels` for Windows, invoke script `.\scripts\BuildWheels.ps1` using PowerShell. Just make sure that your execution policy allows execution of scripts in your environment. @@ -67,7 +67,7 @@ pip install pyignite To install a specific version: ```bash -pip install pyignite==0.5.1 +pip install pyignite==0.6.0 ``` ## Documentation diff --git a/pyignite/__init__.py b/pyignite/__init__.py index 1b0a9c2..9d55337 100644 --- a/pyignite/__init__.py +++ b/pyignite/__init__.py @@ -17,4 +17,4 @@ from pyignite.aio_client import AioClient from pyignite.binary import GenericObjectMeta -__version__ = '0.6.0-dev' +__version__ = '0.6.0' From a0600047e7b29fc23350f77d4b087cfb55032d72 Mon Sep 17 00:00:00 2001 From: Ivan Daschinsky Date: Wed, 9 Nov 2022 17:28:04 +0300 Subject: [PATCH 2/7] Add release notes for 0.6.0 --- RELEASE_NOTES.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index a67624a..b246202 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,6 +1,15 @@ Apache Ignite python thin client ================================ +0.6.0 +-------------------------------- +* Added support of python 3.11 +* Dropped support of python 3.6 +* Fixed non-intuitive automatically setting of flag use_ssl whet the authentication is enabled. +* Added timeout support for cache operations in the async client. +* Fixed incorrect result setting of already completed futures in async connection implementation. +* Fixed examples and documentation. + 0.5.2 -------------------------------- * Fixed incorrect partial read from socket in sync client From dfd7bf40dc52723eff80000b6f4b32a8601af549 Mon Sep 17 00:00:00 2001 From: Ivan Daschinskiy Date: Mon, 14 Nov 2022 15:29:12 +0300 Subject: [PATCH 3/7] Exclude unnecessary directory 'tests' in wheels (#60) (cherry picked from commit d5afd76a697293b22103caf00f63ef447ed3a613) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 827066a..e92d7b9 100644 --- a/setup.py +++ b/setup.py @@ -99,7 +99,7 @@ def run_setup(with_binary=True): long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/apache/ignite-python-thin-client', - packages=setuptools.find_packages(), + packages=setuptools.find_packages(exclude=["tests*"]), install_requires=install_requirements, license="Apache License 2.0", license_files=('LICENSE', 'NOTICE'), From 995bda81780402116e89d76523949da88136f260 Mon Sep 17 00:00:00 2001 From: Ivan Daschinsky Date: Mon, 14 Nov 2022 15:31:59 +0300 Subject: [PATCH 4/7] Fix typo in RELEASE_NOTES.txt --- RELEASE_NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index b246202..82c9f05 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -5,7 +5,7 @@ Apache Ignite python thin client -------------------------------- * Added support of python 3.11 * Dropped support of python 3.6 -* Fixed non-intuitive automatically setting of flag use_ssl whet the authentication is enabled. +* Fixed non-intuitive automatically setting of flag use_ssl when the authentication is enabled. * Added timeout support for cache operations in the async client. * Fixed incorrect result setting of already completed futures in async connection implementation. * Fixed examples and documentation. From 66e1b4e5cf68b8cb76670ae2a9c7c804bfcd8dec Mon Sep 17 00:00:00 2001 From: Ivan Daschinsky Date: Tue, 14 Feb 2023 13:32:26 +0300 Subject: [PATCH 5/7] Prepare 0.6.1 release --- README.md | 2 +- pyignite/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e755498..0f63d9a 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ pip install pyignite To install a specific version: ```bash -pip install pyignite==0.6.0 +pip install pyignite==0.6.1 ``` ## Documentation diff --git a/pyignite/__init__.py b/pyignite/__init__.py index 9d55337..086d7e9 100644 --- a/pyignite/__init__.py +++ b/pyignite/__init__.py @@ -17,4 +17,4 @@ from pyignite.aio_client import AioClient from pyignite.binary import GenericObjectMeta -__version__ = '0.6.0' +__version__ = '0.6.1' From da37d86016f0aeee82a410a496a794d3884e534c Mon Sep 17 00:00:00 2001 From: Ivan Daschinskiy Date: Tue, 14 Feb 2023 13:27:20 +0300 Subject: [PATCH 6/7] IGNITE-18788 Fix firing query events only if debug level logger enabled. (#62) (cherry picked from commit b32131b28bc83d96d60ec2f0090a5958fd87ed53) --- .github/workflows/pr_check.yml | 4 ++-- pyignite/queries/query.py | 29 +++++++++++++++-------------- tests/common/test_query_listener.py | 12 ++++++++++++ tox.ini | 6 ++++-- 4 files changed, 33 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 2330e1d..8ceefb7 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v4.3.0 with: python-version: ${{ matrix.cfg.python}} - name: Install Apache Ignite @@ -54,7 +54,7 @@ jobs: - name: Install tox run: | - pip install tox + pip install tox==3.28.0 - name: Run tests run: | diff --git a/pyignite/queries/query.py b/pyignite/queries/query.py index c141b26..6ac16d8 100644 --- a/pyignite/queries/query.py +++ b/pyignite/queries/query.py @@ -247,26 +247,27 @@ def _on_query_started(self, conn): self.op_code, _get_op_code_name(self.op_code)) def _on_query_finished(self, conn, result=None, err=None): - if logger.isEnabledFor(logging.DEBUG): - dur_ms = _sec_to_millis(time.monotonic() - self._start_ts) - if result and result.status != 0: - err = result.message - if err: + dur_ms = _sec_to_millis(time.monotonic() - self._start_ts) + if result and result.status != 0: + err = result.message + if err: + if logger.isEnabledFor(logging.DEBUG): logger.debug("Failed to perform query(query_id=%d, op_type=%s, host=%s, port=%d, node_id=%s) " "in %d ms: %s", self.query_id, _get_op_code_name(self.op_code), conn.host, conn.port, conn.uuid, dur_ms, err) - if self._enabled_query_listener(conn): - self._event_listener(conn).publish_query_fail(conn.host, conn.port, conn.uuid, self.query_id, - self.op_code, _get_op_code_name(self.op_code), - dur_ms, err) - else: + if self._enabled_query_listener(conn): + self._event_listener(conn).publish_query_fail(conn.host, conn.port, conn.uuid, self.query_id, + self.op_code, _get_op_code_name(self.op_code), + dur_ms, err) + else: + if logger.isEnabledFor(logging.DEBUG): logger.debug("Finished query(query_id=%d, op_type=%s, host=%s, port=%d, node_id=%s) " "successfully in %d ms", self.query_id, _get_op_code_name(self.op_code), conn.host, conn.port, conn.uuid, dur_ms) - if self._enabled_query_listener(conn): - self._event_listener(conn).publish_query_success(conn.host, conn.port, conn.uuid, self.query_id, - self.op_code, _get_op_code_name(self.op_code), - dur_ms) + if self._enabled_query_listener(conn): + self._event_listener(conn).publish_query_success(conn.host, conn.port, conn.uuid, self.query_id, + self.op_code, _get_op_code_name(self.op_code), + dur_ms) class ConfigQuery(Query): diff --git a/tests/common/test_query_listener.py b/tests/common/test_query_listener.py index 8310117..85d1550 100644 --- a/tests/common/test_query_listener.py +++ b/tests/common/test_query_listener.py @@ -36,6 +36,18 @@ def on_query_success(self, event): events.append(event) +@pytest.fixture(autouse=True) +def setup_logger(): + from pyignite.queries.query import logger + + try: + # Disable logger in order to test events with disabled debug logging. + logger.disabled = True + yield logger + finally: + logger.disabled = False + + @pytest.fixture def client(): client = Client(event_listeners=[QueryRouteListener()]) diff --git a/tox.ini b/tox.ini index d68f02e..2fe65b4 100644 --- a/tox.ini +++ b/tox.ini @@ -29,11 +29,13 @@ max-line-length=120 ignore = F401,F403,F405,F821 [testenv:codestyle] -basepython = python3.8 +basepython = python3.11 commands = flake8 [testenv] -passenv = TEAMCITY_VERSION IGNITE_HOME +passenv = + TEAMCITY_VERSION + IGNITE_HOME envdir = {homedir}/.virtualenvs/pyignite-{envname} deps = -r ./requirements/install.txt From 0d86f44e86270f4d578afbce41aa2d6c424d2615 Mon Sep 17 00:00:00 2001 From: Ivan Daschinsky Date: Tue, 14 Feb 2023 18:43:16 +0300 Subject: [PATCH 7/7] Add release notes for 0.6.1 --- RELEASE_NOTES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 82c9f05..86448e9 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,6 +1,10 @@ Apache Ignite python thin client ================================ +0.6.1 +-------------------------------- +* Fixed query listener fires events only if debug logging level enabled. + 0.6.0 -------------------------------- * Added support of python 3.11