From ace834740dda119b2394dbc03d49ced73db36e66 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 10 Dec 2025 12:24:14 +0300 Subject: [PATCH 1/4] * Update max Python version in tests to 3.14 * Update pytest --- .github/workflows/get-python-versions.yml | 2 +- requirements-test.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/get-python-versions.yml b/.github/workflows/get-python-versions.yml index eedfd6a09a..e7cbb5b5c7 100644 --- a/.github/workflows/get-python-versions.yml +++ b/.github/workflows/get-python-versions.yml @@ -20,7 +20,7 @@ jobs: steps: - id: extract-versions run: | - python_versions='[ "3.11", "3.12", "3.13" ]' + python_versions='[ "3.11", "3.12", "3.13", "3.14" ]' echo "python-versions=${python_versions}" >> $GITHUB_OUTPUT echo "earliest-python-version=$(echo "${python_versions}" | jq --raw-output '.[0]')" >> $GITHUB_OUTPUT diff --git a/requirements-test.txt b/requirements-test.txt index 97d2937a54..e4b9c4b6fa 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,5 +2,5 @@ thrift==0.13.0 psutil>=5.8.0 mock==3.0.5 parameterized==0.7.4 -pytest==6.2.5 -pytest-cov==3.0.0 \ No newline at end of file +pytest==9.0.2 +pytest-cov==7.0.0 \ No newline at end of file From d4a9105513508f76b95c05def4ffd8f198a4e402 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 10 Dec 2025 12:29:34 +0300 Subject: [PATCH 2/4] Black --- examples/map/map_portable_versioning_example.py | 1 + hazelcast/core.py | 1 + .../internal/asyncio_proxy/vector_collection.py | 6 +++--- hazelcast/proxy/vector_collection.py | 6 +++--- hazelcast/serialization/__init__.py | 1 + hazelcast/serialization/api.py | 1 + hazelcast/serialization/serialization_const.py | 1 + requirements-dev.txt | 2 +- .../serialization/serializers_test.py | 6 ++++-- tests/integration/dbapi/dbapi20.py | 16 ++++++++-------- tests/unit/serialization/serializers_test.py | 2 +- 11 files changed, 25 insertions(+), 18 deletions(-) diff --git a/examples/map/map_portable_versioning_example.py b/examples/map/map_portable_versioning_example.py index 80d7c0a488..1291a376b8 100644 --- a/examples/map/map_portable_versioning_example.py +++ b/examples/map/map_portable_versioning_example.py @@ -91,6 +91,7 @@ def __eq__(self, other): # However, having a version that changes across incompatible field types such as int and String will cause # a type error as members with older versions of the class tries to access it. We will demonstrate this below. + # Version3: Changed age field type from int to String. (Incompatible type change) class Employee3(Portable): FACTORY_ID = 666 diff --git a/hazelcast/core.py b/hazelcast/core.py index 3443759e44..9bc2bc62c5 100644 --- a/hazelcast/core.py +++ b/hazelcast/core.py @@ -1,4 +1,5 @@ """Hazelcast Core objects and constants.""" + import json import typing import uuid diff --git a/hazelcast/internal/asyncio_proxy/vector_collection.py b/hazelcast/internal/asyncio_proxy/vector_collection.py index 4abe7fb3b2..e69e6354d5 100644 --- a/hazelcast/internal/asyncio_proxy/vector_collection.py +++ b/hazelcast/internal/asyncio_proxy/vector_collection.py @@ -165,9 +165,9 @@ def _search_near_vector_internal( hints: Dict[str, str] = None ) -> asyncio.Future[List[SearchResult]]: def handler(message): - results: List[ - SearchResult - ] = vector_collection_search_near_vector_codec.decode_response(message) + results: List[SearchResult] = ( + vector_collection_search_near_vector_codec.decode_response(message) + ) for result in results: if result.key is not None: result.key = self._to_object(result.key) diff --git a/hazelcast/proxy/vector_collection.py b/hazelcast/proxy/vector_collection.py index 424227a9e6..fef9a56ae2 100644 --- a/hazelcast/proxy/vector_collection.py +++ b/hazelcast/proxy/vector_collection.py @@ -342,9 +342,9 @@ def _search_near_vector_internal( hints: Dict[str, str] = None ) -> Future[List[SearchResult]]: def handler(message): - results: List[ - SearchResult - ] = vector_collection_search_near_vector_codec.decode_response(message) + results: List[SearchResult] = ( + vector_collection_search_near_vector_codec.decode_response(message) + ) for result in results: if result.key is not None: result.key = self._to_object(result.key) diff --git a/hazelcast/serialization/__init__.py b/hazelcast/serialization/__init__.py index c9ea28baa9..35a1e18983 100644 --- a/hazelcast/serialization/__init__.py +++ b/hazelcast/serialization/__init__.py @@ -1,5 +1,6 @@ """ Serialization Module """ + from hazelcast.serialization.bits import * from hazelcast.serialization.service import SerializationServiceV1 diff --git a/hazelcast/serialization/api.py b/hazelcast/serialization/api.py index 6b323b7930..454c235d62 100644 --- a/hazelcast/serialization/api.py +++ b/hazelcast/serialization/api.py @@ -1,6 +1,7 @@ """ User API for Serialization. """ + import abc import datetime import decimal diff --git a/hazelcast/serialization/serialization_const.py b/hazelcast/serialization/serialization_const.py index 3af96c37a0..182ffa5cfb 100644 --- a/hazelcast/serialization/serialization_const.py +++ b/hazelcast/serialization/serialization_const.py @@ -1,6 +1,7 @@ """ Serialization type ids """ + # Serialization Constants CONSTANT_TYPE_NULL = 0 CONSTANT_TYPE_PORTABLE = -1 diff --git a/requirements-dev.txt b/requirements-dev.txt index 6abac41cf5..0b02ad6a35 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ -r requirements-test.txt -black==22.3.0 +black==25.12.0 Sphinx==7.2.6 sphinx-rtd-theme==2.0.0 mypy==0.940 diff --git a/tests/integration/backward_compatible/serialization/serializers_test.py b/tests/integration/backward_compatible/serialization/serializers_test.py index 246c9d16d8..cc2688a3dc 100644 --- a/tests/integration/backward_compatible/serialization/serializers_test.py +++ b/tests/integration/backward_compatible/serialization/serializers_test.py @@ -132,7 +132,7 @@ def test_emoji(self): self.assertEqual(value, response) def test_utf_chars(self): - value = "\u0040\u0041\u01DF\u06A0\u12E0\u1D306" + value = "\u0040\u0041\u01df\u06a0\u12e0\u1d306" self.map.set("key", value) self.assertEqual(value, self.map.get("key")) response = self.get_from_server() @@ -359,7 +359,9 @@ def test_double_array_from_server(self): self.assertEqual([3123.0, -123.0], self.map.get("key")) def test_string_array_from_server(self): - self.assertTrue(self.set_on_server('Java.to(["hey", "1βšδΈ­πŸ’¦2πŸ˜­β€πŸ™†πŸ˜”5"], "java.lang.String[]")')) + self.assertTrue( + self.set_on_server('Java.to(["hey", "1βšδΈ­πŸ’¦2πŸ˜­β€πŸ™†πŸ˜”5"], "java.lang.String[]")') + ) self.assertEqual(["hey", "1βšδΈ­πŸ’¦2πŸ˜­β€πŸ™†πŸ˜”5"], self.map.get("key")) def test_date_from_server(self): diff --git a/tests/integration/dbapi/dbapi20.py b/tests/integration/dbapi/dbapi20.py index d23d0bc70d..723028421c 100644 --- a/tests/integration/dbapi/dbapi20.py +++ b/tests/integration/dbapi/dbapi20.py @@ -1,14 +1,14 @@ #!/usr/bin/env python -""" Python DB API 2.0 driver compliance unit test suite. - - This software is Public Domain and may be used without restrictions. +"""Python DB API 2.0 driver compliance unit test suite. - "Now we have booze and barflies entering the discussion, plus rumours of - DBAs on drugs... and I won't tell you what flashes through my mind each - time I read the subject line with 'Anal Compliance' in it. All around - this is turning out to be a thoroughly unwholesome unit test." + This software is Public Domain and may be used without restrictions. - -- Ian Bicking +"Now we have booze and barflies entering the discussion, plus rumours of + DBAs on drugs... and I won't tell you what flashes through my mind each + time I read the subject line with 'Anal Compliance' in it. All around + this is turning out to be a thoroughly unwholesome unit test." + + -- Ian Bicking """ __version__ = "1.15.0" diff --git a/tests/unit/serialization/serializers_test.py b/tests/unit/serialization/serializers_test.py index 6b5813753b..889966e7b6 100644 --- a/tests/unit/serialization/serializers_test.py +++ b/tests/unit/serialization/serializers_test.py @@ -51,7 +51,7 @@ def test_string(self): self.validate("client") self.validate("1βšδΈ­πŸ’¦2πŸ˜­β€πŸ™†πŸ˜”5") self.validate("IΓ±tΓ«rnΓ’tiΓ΄nΓ lizΓ¦tiΓΈn") - self.validate("\u0040\u0041\u01DF\u06A0\u12E0\u1D30") + self.validate("\u0040\u0041\u01df\u06a0\u12e0\u1d30") def test_bytearray(self): self.validate(bytearray("abc".encode())) From 2e3aeeca323c437a580a5363ad4ea7aeaede820b Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 10 Dec 2025 12:55:03 +0300 Subject: [PATCH 3/4] Update --- Makefile | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f783524c4c..c202fb1453 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: check test test-cover check: - mypy --show-error-codes hazelcast + mypy --show-error-codes --python-version 3.14 hazelcast black --check --config black.toml . test: diff --git a/setup.py b/setup.py index 7335d75f28..f834e02c32 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,7 @@ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", ], From ef76da2a8b1c4a26db617c20ef548461f1b3c2c6 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 10 Dec 2025 13:30:48 +0300 Subject: [PATCH 4/4] Force mypy to use Python 3.14 mode --- .github/workflows/linter_docs_mypy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter_docs_mypy.yaml b/.github/workflows/linter_docs_mypy.yaml index b9e3faae54..872e367be8 100644 --- a/.github/workflows/linter_docs_mypy.yaml +++ b/.github/workflows/linter_docs_mypy.yaml @@ -74,4 +74,4 @@ jobs: - name: Run mypy run: | - mypy --show-error-codes hazelcast + mypy --show-error-codes --python-version 3.14 hazelcast