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/README.md b/README.md index be5fa7b..0f63d9a 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.1 ``` ## Documentation diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index a67624a..86448e9 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,6 +1,19 @@ 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 +* Dropped support of python 3.6 +* 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. + 0.5.2 -------------------------------- * Fixed incorrect partial read from socket in sync client diff --git a/pyignite/__init__.py b/pyignite/__init__.py index 1b0a9c2..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-dev' +__version__ = '0.6.1' 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/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'), 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