Skip to content

Commit dfdba33

Browse files
authored
Merge branch 'main' into main
2 parents 4c4943c + 1001431 commit dfdba33

File tree

14 files changed

+120
-95
lines changed

14 files changed

+120
-95
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 5.5.0rc2
2+
current_version = 5.5.0rc3
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<releaselevel>[a-z]+)?

Changelog.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,52 @@
44
Change history
55
================
66

7+
.. _version-5.5.0rc3:
8+
9+
5.5.0rc3
10+
========
11+
:release-date: 20 Feb, 2025
12+
:release-by: Tomer Nosrati
13+
14+
Key Highlights
15+
~~~~~~~~~~~~~~
16+
17+
Native Delayed Delivery
18+
-----------------------
19+
20+
Official support to `RabbitMQ Delayed Delivery <https://docs.particular.net/transports/rabbitmq/delayed-delivery>`_,
21+
which is required to enable ETA tasks with quorum queues in Celery.
22+
23+
urllib3 instead of curl
24+
-----------------------
25+
26+
We can finally say goodbye to the :pypi:`pycurl` dependency and use :pypi:`urllib3` instead.
27+
28+
Transport: Google Pub/Sub
29+
-------------------------
30+
31+
New support for Google Pub/Sub as a transport broker.
32+
33+
What's Changed
34+
~~~~~~~~~~~~~~
35+
36+
- Bump pytest-cov from 5.0.0 to 6.0.0 (#2183)
37+
- Add documentation for debug logs environment variables (#2186)
38+
- Add documentation for py-amqp transport options (#2187)
39+
- Bump codecov/codecov-action from 4 to 5 (#2189)
40+
- Update pytest to 8.3.4 (#2196)
41+
- Update redis requirement from !=4.5.5,!=5.0.2,<=5.2.0,>=4.5.2 to >=4.5.2,!=4.5.5,!=5.0.2,<=5.2.1 (#2203)
42+
- Close connections in case of an exception (#2201)
43+
- Bump pytest-freezer from 0.4.8 to 0.4.9 (#2205)
44+
- Bump mypy from 1.13.0 to 1.14.0 (#2211)
45+
- fix(sqs): don't crash on multiple predefined queues with aws sts session (#2224)
46+
- Bump mypy from 1.14.0 to 1.14.1 (#2215)
47+
- Bump tzdata from 2024.2 to 2025.1 (#2230)
48+
- fix: interpret the ssl_check_hostname as a boolean (#2229)
49+
- Revert "Resolving TypeError, during version unpacking " (#2225)
50+
- Bump flake8 from 7.1.1 to 7.1.2 (#2244)
51+
- Prepare for (pre) release: v5.5.0rc3 (#2247)
52+
753
.. _version-5.5.0rc2:
854

955
5.5.0rc2

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
|build-status| |coverage| |license| |wheel| |pyversion| |pyimp| |downloads|
66

7-
:Version: 5.5.0rc2
7+
:Version: 5.5.0rc3
88
:Documentation: https://kombu.readthedocs.io/
99
:Download: https://pypi.org/project/kombu/
1010
:Source: https://github.com/celery/kombu/

docs/includes/introduction.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:Version: 5.5.0rc2
1+
:Version: 5.5.0rc3
22
:Web: https://kombu.readthedocs.io/
33
:Download: https://pypi.org/project/kombu/
44
:Source: https://github.com/celery/kombu/

examples/delayed_infra.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
from __future__ import annotations
22

3-
from examples.experimental.async_consume import queue
43
from kombu import Connection, Exchange, Queue
54
from kombu.transport.native_delayed_delivery import (
65
bind_queue_to_native_delayed_delivery_exchange, calculate_routing_key,
76
declare_native_delayed_delivery_exchanges_and_queues, level_name)
87

98
with Connection('amqp://guest:guest@localhost:5672//') as connection:
109
declare_native_delayed_delivery_exchanges_and_queues(connection, 'quorum')
10+
channel = connection.channel()
1111

12-
destination_exchange = Exchange(
13-
'destination', type='topic')
14-
destination_queue = Queue("destination", exchange=destination_exchange)
15-
bind_queue_to_native_delayed_delivery_exchange(connection, queue)
12+
destination_exchange = Exchange('destination_exchange', type='topic')
13+
queue = Queue("destination", exchange=destination_exchange, routing_key='destination_route')
14+
queue.declare(channel=connection.channel())
1615

17-
channel = connection.channel()
16+
bind_queue_to_native_delayed_delivery_exchange(connection, queue)
1817
with connection.Producer(channel=channel) as producer:
19-
routing_key = calculate_routing_key(30, 'destination')
18+
routing_key = calculate_routing_key(30, 'destination_route')
2019
producer.publish(
2120
"delayed msg",
2221
routing_key=routing_key,

kombu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from collections import namedtuple
99
from typing import Any, cast
1010

11-
__version__ = '5.5.0rc2'
11+
__version__ = '5.5.0rc3'
1212
__author__ = 'Ask Solem'
1313
__contact__ = '[email protected]'
1414
__homepage__ = 'https://kombu.readthedocs.io'

kombu/utils/text.py

Lines changed: 21 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
"""Text Utilities."""
2-
32
# flake8: noqa
43

54

65
from __future__ import annotations
76

8-
import re
97
from difflib import SequenceMatcher
108
from typing import Iterable, Iterator
119

@@ -16,15 +14,12 @@ def escape_regex(p, white=''):
1614
# type: (str, str) -> str
1715
"""Escape string for use within a regular expression."""
1816
# what's up with re.escape? that code must be neglected or something
19-
return ''.join(
20-
c if c.isalnum() or c in white else ('\\000' if c == '\000' else '\\' + c)
21-
for c in p
22-
)
17+
return ''.join(c if c.isalnum() or c in white
18+
else ('\\000' if c == '\000' else '\\' + c)
19+
for c in p)
2320

2421

25-
def fmatch_iter(
26-
needle: str, haystack: Iterable[str], min_ratio: float = 0.6
27-
) -> Iterator[tuple[float, str]]:
22+
def fmatch_iter(needle: str, haystack: Iterable[str], min_ratio: float = 0.6) -> Iterator[tuple[float, str]]:
2823
"""Fuzzy match: iteratively.
2924
3025
Yields
@@ -37,76 +32,39 @@ def fmatch_iter(
3732
yield ratio, key
3833

3934

40-
def fmatch_best(
41-
needle: str, haystack: Iterable[str], min_ratio: float = 0.6
42-
) -> str | None:
35+
def fmatch_best(needle: str, haystack: Iterable[str], min_ratio: float = 0.6) -> str | None:
4336
"""Fuzzy match - Find best match (scalar)."""
4437
try:
4538
return sorted(
46-
fmatch_iter(needle, haystack, min_ratio),
47-
reverse=True,
48-
)[
49-
0
50-
][1]
39+
fmatch_iter(needle, haystack, min_ratio), reverse=True,
40+
)[0][1]
5141
except IndexError:
5242
return None
5343

5444

55-
def version_string_as_tuple(version: str) -> version_info_t:
56-
"""Parse a version string into its components and return a version_info_t tuple.
57-
58-
The version string is expected to follow the pattern:
59-
'major.minor.micro[releaselevel][serial]'. Each component of the version
60-
is extracted and returned as a tuple in the format (major, minor, micro,
61-
releaselevel, serial).
62-
63-
Args
64-
----
65-
version (str): The version string to parse.
66-
67-
Returns
68-
-------
69-
version_info_t: A tuple containing the parsed version components.
70-
71-
Raises
72-
------
73-
ValueError: If the version string is invalid and does not match the expected pattern.
74-
"""
75-
pattern = r'^(\d+)' # catching the major version (mandatory)
76-
pattern += r'(?:\.(\d+))?' # optionally catching the minor version
77-
pattern += r'(?:\.(\d+))?' # optionally catching the micro version
78-
pattern += r'(?:\.*([a-zA-Z+-][\da-zA-Z+-]*))?' # optionally catching the release level (starting with a letter, + or -) after a dot
79-
pattern += r'(?:\.(.*))?' # optionally catching the serial number after a dot
80-
81-
# applying the regex pattern to the input version string
82-
match = re.match(pattern, version)
83-
84-
if not match:
85-
raise ValueError(f"Invalid version string: {version}")
86-
87-
# extracting the matched groups
88-
major = int(match.group(1))
89-
minor = int(match.group(2)) if match.group(2) else 0
90-
micro = int(match.group(3)) if match.group(3) else 0
91-
releaselevel = match.group(4) if match.group(4) else ''
92-
serial = match.group(5) if match.group(5) else ''
93-
94-
return _unpack_version(major, minor, micro, releaselevel, serial)
45+
def version_string_as_tuple(s: str) -> version_info_t:
46+
"""Convert version string to version info tuple."""
47+
v = _unpack_version(*s.split('.'))
48+
# X.Y.3a1 -> (X, Y, 3, 'a1')
49+
if isinstance(v.micro, str):
50+
v = version_info_t(v.major, v.minor, *_splitmicro(*v[2:]))
51+
# X.Y.3a1-40 -> (X, Y, 3, 'a1', '40')
52+
if not v.serial and v.releaselevel and '-' in v.releaselevel:
53+
v = version_info_t(*list(v[0:3]) + v.releaselevel.split('-'))
54+
return v
9555

9656

9757
def _unpack_version(
98-
major: str | int = 0,
58+
major: str,
9959
minor: str | int = 0,
10060
micro: str | int = 0,
10161
releaselevel: str = '',
102-
serial: str = '',
62+
serial: str = ''
10363
) -> version_info_t:
104-
return version_info_t(int(major), int(minor), int(micro), releaselevel, serial)
64+
return version_info_t(int(major), int(minor), micro, releaselevel, serial)
10565

10666

107-
def _splitmicro(
108-
micro: str, releaselevel: str = '', serial: str = ''
109-
) -> tuple[int, str, str]:
67+
def _splitmicro(micro: str, releaselevel: str = '', serial: str = '') -> tuple[int, str, str]:
11068
for index, char in enumerate(micro):
11169
if not char.isdigit():
11270
break

kombu/utils/url.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def parse_url(url):
3939
if query:
4040
keys = [key for key in query.keys() if key.startswith('ssl_')]
4141
for key in keys:
42-
if key == 'ssl_cert_reqs':
42+
if key == "ssl_check_hostname":
43+
query[key] = query[key].lower() != 'false'
44+
elif key == 'ssl_cert_reqs':
4345
query[key] = parse_ssl_cert_reqs(query[key])
4446
if query[key] is None:
4547
logger.warning('Defaulting to insecure SSL behaviour.')

requirements/default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ typing_extensions==4.12.2; python_version<"3.10"
22
amqp>=5.1.1,<6.0.0
33
vine==5.1.0
44
backports.zoneinfo[tzdata]>=0.2.1; python_version<"3.9"
5-
tzdata==2024.2; python_version>="3.9"
5+
tzdata==2025.1; python_version>="3.9"

requirements/pkgutils.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
setuptools>=47.0.0
22
wheel>=0.29.0
3-
flake8==7.1.1
3+
flake8==7.1.2
44
tox>=4.4.8
55
sphinx2rst>=1.0
66
bumpversion==0.6.0

0 commit comments

Comments
 (0)