From 37d42056358bd78f8361d694a0d23ddfe1a0ad7a Mon Sep 17 00:00:00 2001 From: hariton27sy Date: Thu, 3 Apr 2025 02:17:17 +0500 Subject: [PATCH 1/5] Fix error of double normalization options from URI in mongodb transport --- kombu/transport/mongodb.py | 4 +++- t/unit/transport/test_mongodb.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kombu/transport/mongodb.py b/kombu/transport/mongodb.py index ae8da59df..c2f68aa86 100644 --- a/kombu/transport/mongodb.py +++ b/kombu/transport/mongodb.py @@ -305,7 +305,9 @@ def _parse_uri(self, scheme='mongodb://'): port = client.port if client.port else self.default_port - parsed = uri_parser.parse_uri(hostname, port) + # We disable validating and normalization parameters here, + # because pymongo will validate and normalize parameters later in __init__ of MongoClient + parsed = uri_parser.parse_uri(hostname, port, validate=False) dbname = parsed['database'] or client.virtual_host diff --git a/t/unit/transport/test_mongodb.py b/t/unit/transport/test_mongodb.py index 744bfb22d..732a5c371 100644 --- a/t/unit/transport/test_mongodb.py +++ b/t/unit/transport/test_mongodb.py @@ -116,6 +116,18 @@ def test_correct_readpreference(self): hostname, dbname, options = channel._parse_uri() assert options['readpreference'] == 'nearest' + def test_normalizes_params_from_uri_only_once(self): + channel = _create_mock_connection('mongodb://localhost/?serverselectiontimeoutms=1000').default_channel + + def server_info(self): + return {'version': '3.6.0-rc'} + + with patch.object(pymongo.MongoClient, 'server_info', server_info): + database = channel._open() + + client_options = database.client.options + assert client_options.server_selection_timeout == 1.0 + class BaseMongoDBChannelCase: From f2240005f21d842d5fd81d05f5f4ab41d754d44e Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Fri, 4 Apr 2025 10:52:44 +0100 Subject: [PATCH 2/5] Move use of typing_extensions into TYPE_CHECKING block so that typing-extensions is not required at runtime --- kombu/asynchronous/semaphore.py | 15 +++++++-------- requirements/default.txt | 1 - requirements/pkgutils.txt | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kombu/asynchronous/semaphore.py b/kombu/asynchronous/semaphore.py index 940e6d860..2936459e6 100644 --- a/kombu/asynchronous/semaphore.py +++ b/kombu/asynchronous/semaphore.py @@ -3,21 +3,20 @@ import sys from collections import deque -from typing import TYPE_CHECKING, Callable, Deque - -if sys.version_info < (3, 10): - from typing_extensions import ParamSpec -else: - from typing import ParamSpec +from typing import TYPE_CHECKING if TYPE_CHECKING: from types import TracebackType + from typing import Callable, Deque + if sys.version_info < (3, 10): + from typing_extensions import ParamSpec + else: + from typing import ParamSpec + P = ParamSpec("P") __all__ = ('DummyLock', 'LaxBoundedSemaphore') -P = ParamSpec("P") - class LaxBoundedSemaphore: """Asynchronous Bounded Semaphore. diff --git a/requirements/default.txt b/requirements/default.txt index 1ad71d4fc..4a430ee56 100644 --- a/requirements/default.txt +++ b/requirements/default.txt @@ -1,4 +1,3 @@ -typing_extensions==4.12.2; python_version<"3.10" amqp>=5.1.1,<6.0.0 vine==5.1.0 backports.zoneinfo[tzdata]>=0.2.1; python_version<"3.9" diff --git a/requirements/pkgutils.txt b/requirements/pkgutils.txt index 4a43eb047..8878c1ae4 100644 --- a/requirements/pkgutils.txt +++ b/requirements/pkgutils.txt @@ -6,3 +6,4 @@ sphinx2rst>=1.0 bumpversion==0.6.0 pydocstyle==6.3.0 mypy==1.14.1 +typing_extensions==4.12.2; python_version<"3.10" From 81daa0d1bde68b46926f37424eaac07ad613c830 Mon Sep 17 00:00:00 2001 From: Martin Stolle Date: Wed, 26 Mar 2025 08:55:30 +0100 Subject: [PATCH 3/5] Do not pin package tzdata anymore tzdata is a timezone database that should always be upgradeable, otherwise other projects will run into dependency conflicts --- requirements/default.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/default.txt b/requirements/default.txt index 4a430ee56..6f37acc45 100644 --- a/requirements/default.txt +++ b/requirements/default.txt @@ -1,4 +1,4 @@ amqp>=5.1.1,<6.0.0 vine==5.1.0 backports.zoneinfo[tzdata]>=0.2.1; python_version<"3.9" -tzdata==2025.2; python_version>="3.9" +tzdata>=2025.2; python_version>="3.9" From 1bce376a894e676f877a3588722c6491395e77d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Planquart?= Date: Tue, 8 Apr 2025 11:33:31 +0200 Subject: [PATCH 4/5] fix: typo in pools documentation about use_global_limit (#2285) Co-authored-by: Asif Saif Uddin --- docs/userguide/pools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/userguide/pools.rst b/docs/userguide/pools.rst index cf799445c..e2e6b22c0 100644 --- a/docs/userguide/pools.rst +++ b/docs/userguide/pools.rst @@ -189,4 +189,4 @@ argument: from kombu import pools - connections = pools.Connections(limit=pools.use_default_limit) + connections = pools.Connections(limit=pools.use_global_limit) From 164581299fd4ffc8e96feadf21b54ff2eb7d98b9 Mon Sep 17 00:00:00 2001 From: Tomer Nosrati Date: Wed, 16 Apr 2025 15:45:46 +0300 Subject: [PATCH 5/5] Prepare for release: v5.5.3 (#2288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump version: 5.5.2 → 5.5.3 * Added Changelog for v5.5.3 --- .bumpversion.cfg | 2 +- Changelog.rst | 16 ++++++++++++++++ README.rst | 2 +- docs/includes/introduction.txt | 2 +- kombu/__init__.py | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 6076786b9..56a6f58a7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 5.5.2 +current_version = 5.5.3 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(?P[a-z]+)? diff --git a/Changelog.rst b/Changelog.rst index ace926bc8..f11f7610b 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -4,6 +4,22 @@ Change history ================ +.. _version-5.5.3: + +5.5.3 +===== +:release-date: 16 Apr, 2025 +:release-by: Tomer Nosrati + +What's Changed +~~~~~~~~~~~~~~ + +- Fix error of double normalization options from URI in mongodb transport (#2282) +- Move use of typing_extensions into TYPE_CHECKING block (#2283) +- Do not pin package tzdata anymore (#2274) +- Typo in pools's documentation (#2285) +- Prepare for release: v5.5.3 (#2288) + .. _version-5.5.2: 5.5.2 diff --git a/README.rst b/README.rst index 9f2ff8728..a9ec01fdc 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| |downloads| -:Version: 5.5.2 +:Version: 5.5.3 :Documentation: https://kombu.readthedocs.io/ :Download: https://pypi.org/project/kombu/ :Source: https://github.com/celery/kombu/ diff --git a/docs/includes/introduction.txt b/docs/includes/introduction.txt index 9bee87e3e..da7278bf5 100644 --- a/docs/includes/introduction.txt +++ b/docs/includes/introduction.txt @@ -1,4 +1,4 @@ -:Version: 5.5.2 +:Version: 5.5.3 :Web: https://kombu.readthedocs.io/ :Download: https://pypi.org/project/kombu/ :Source: https://github.com/celery/kombu/ diff --git a/kombu/__init__.py b/kombu/__init__.py index 83430bd59..4998fab90 100644 --- a/kombu/__init__.py +++ b/kombu/__init__.py @@ -8,7 +8,7 @@ from collections import namedtuple from typing import Any, cast -__version__ = '5.5.2' +__version__ = '5.5.3' __author__ = 'Ask Solem' __contact__ = 'auvipy@gmail.com' __homepage__ = 'https://kombu.readthedocs.io'