Commit Graph

3387 Commits

Author SHA1 Message Date
Asif Saif Uddin 0f9f554b7c pytest~=7.1.1 2022-04-17 13:46:43 +06:00
pyup-bot cda4e015d5 create pyup.io config file 2022-04-17 13:10:47 +06:00
Andrii Oriekhov bfd5926913 add GitHub URL for PyPi 2022-04-17 13:08:32 +06:00
Asif Saif Uddin d2f4ee3118
try new py-amqp release (#1534) 2022-04-17 13:04:08 +06:00
dobosevych 260823304f
json.py cleaning from outdated libs (#1533)
* json.py cleaning from outdated libs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* 1. Removed cjson and simplejson from documentation, as those libraries aren't supported anymore
2. Removed _json_extra_kwargs from json.py

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-16 16:57:37 +06:00
Marcelo Trylesinski 7516daf7a7 Bump pyupgrade version and add __future__.annotations import 2022-04-15 14:16:57 +06:00
Marcelo Trylesinski a93099b671
Annotate init files (#1527)
* Annotate init files

* Fix fmatch_best annotation
2022-04-14 11:10:01 +06:00
Sondre Lillebø Gundersen 87384a91c6 chore: Update `__exit__` signatures
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-04-12 20:41:29 +06:00
Marcelo Trylesinski 7d99b6f79f
Annotate `utils/uuid.py` and `utils/text.py` (#1514)
* Annotate `utils/uuid.py` and `utils/text.py`

* Use callable without any parameter

* Update kombu/utils/text.py
2022-04-12 20:39:42 +06:00
dobosevych 894ddfc8b6
Added possibility to serialize and deserialize binary messages in json (#1516)
* Added possibility to serialize and deserialize binary messages in json

* Flake8 fixed

* Hypothesis added to improve test range. Fixed issue b'\x80' serialization.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added docstring

* Fixed pylint

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-12 18:52:41 +06:00
Sondre Lillebø Gundersen 4b67ad1692 chore: Annotate semaphore.py
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2022-04-12 17:11:49 +06:00
pre-commit-ci[bot] 4342af8077 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0)
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0)
2022-04-12 11:03:22 +06:00
Marcelo Trylesinski ea11a0b787
Add `mypy` to the pipeline (#1512)
* Add `mypy` to the pipeline

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-09 12:05:57 +06:00
Keoni Garner 54638f251b Use new entry_points interface 2022-04-07 09:49:49 +06:00
Jonathan Lopez 659c99a947 Correct documentation stating kombu uses pickle protocol version 2 2022-04-06 11:06:27 +06:00
Oliver Nemček aab2588c4a
Protect set of ready tasks by lock to avoid concurrent updates. (#1489)
When there is no locking then there is a possibility that multiple threads
manipulate with the same object at the same time.
The issue is manifested as:
```
RuntimeError: Set changed size during iteration
```

See: https://github.com/celery/celery/issues/7162
2022-03-24 16:49:17 +02:00
Gao 0282e1419f
Add fanout to filesystem (#1499)
* Create a folder for each queue when using filesystem transport and add fanout support

* clean up unused variables

* Add fanout support to filesystem transport

filesystem transport lacks of fanout support.

1. Add fanout support to filesystem transport.
2. Add a unit test for it.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove the refactoring work and make the test passed

1. Remove all of refactoring work
2. make the test pass

* Use pathlib for some Path operation

* Some reviewed changes

Co-authored-by: Yuriy Halytskyy <y.halytskyy@auckland.ac.nz>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-15 20:21:07 +06:00
pre-commit-ci[bot] d57dde5631 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1)
2022-03-15 12:01:12 +06:00
Asif Saif Uddin 444aa42d4a Bump version: 5.2.3 → 5.2.4 2022-03-06 10:59:46 +06:00
Asif Saif Uddin 367b0eb445 changelog entry for v5.2.4 release 2022-03-06 10:56:44 +06:00
Mateusz Marczak 907c04693f Fix SQS extract_task_name message reference 2022-03-04 12:14:16 +06:00
Shane Hathaway 9b505f4297 Add an option to not base64-encode SQS messages.
Also simplify the base64 decoding logic so that we don't have to
run base64 decoding twice for every message.
2022-03-04 11:47:01 +06:00
Asif Saif Uddin 22adaaa38b
try pytest 7 (#1497) 2022-03-01 14:53:09 +06:00
vinay karanam 3475986ee0
Added global_keyprefix support for pubsub clients (#1495)
* Added global_keyprefix support for pubsub clients

* Added test cases
2022-02-28 16:48:09 +06:00
Mads Jensen f1317aa8c1 All supported versions of Python define __package__.
https://www.python.org/dev/peps/pep-0366/ lists Python 2.6 and 3.0 as
the minimum requirements for this attribute. sys.__dict__ contains it.
2022-02-02 19:24:49 +06:00
Michael Manganiello 2f3b153acc
Warn about missing hostname only when default one is available (#1488)
* Warn about missing hostname only when default one is available

The `No hostname was supplied` warning is affecting projects that use
AWS SQS (as detailed in #1357), as a hostname is not required when
setting up the broker URL. Instead, the official documentation [0] specifies
that the valid broker URL formats are:

* `sqs://`
* `sqs://aws_access_key_id:aws_secret_access_key@`

With these formats, the `kombu.utils.url.parse_url` util doesn't return
a hostname, and workers end up triggering the following warning:

> No hostname was supplied. Reverting to default 'None'

As the SQS transport doesn't provide a default value for hostname, this
diff changes the behavior to only warn the user when the hostname hasn't
been supplied but a default one is being set by the default connection
parameters for the defined transport.

Fixes #1357.

[0] https://docs.celeryproject.org/en/stable/getting-started/backends-and-brokers/sqs.html#configuration

* Use caplog default logging level of WARNING
2022-02-02 19:23:14 +06:00
Mads Jensen ac92e047c1
Remove use of OrderedDict in various places (#1483)
* Remove use of OrderedDict in Connection.info.

* Remove remnant use of collections.OrderedDict

* Undo QoS._delivered move to Python standard dictionary.

This requires more work to convert, due to a hack in how the dictionary
is used.

* Undo LRUCache.data to dict conversion.

It's also problematic, and caused tests to fail.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert QoS._delivered comment chagne.

* Update comment

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-30 19:46:45 +06:00
Mads Jensen 31a84d5b3d
Some small updates (#1486)
* Some small updates

* Update QpidException super-call to Python 3 syntax.
2022-01-30 18:34:54 +06:00
Denis Kubashevskiy 3ec6dc0fd1
Set redelivered property for Celery with Redis (#1484)
* Set redelivered property for Celery with Redis

Fixed setting `redelivered` value for Celery when Redis broker is used.

* Add `test_do_restore_message_celery` test

* Fix long line
2022-01-28 20:16:22 +06:00
Lemon Shi 5bed2a8f98 The times of retrying is not correct
The times of retrying was 'max_retries' plus 1 which is fixed now.
2022-01-22 18:10:19 +06:00
John Koehl a7355ac442
Fix issue #789: Async http code not allowing for proxy config (#790)
* (Issue #789) Don't reset the proxy config in the async curl based http request building unless that is specified by the caller

* Test curl proxy only set when explicitly specified by caller

Co-authored-by: Adam Aljets <aljets@users.noreply.github.com>
2022-01-14 09:37:46 +06:00
Paul Brown 1cb3f6e451
Revert "try pining setuptools (#1466)" (#1481)
* Revert "try pining setuptools (#1466)"

This reverts commit 6ddf940940.

* Revert "try restrict setuptool in CI"

This reverts commit c4a8c2a69f.

* require setuptools>=47.0.0 in pkgutils.txt (version that dropped py2 support)
2022-01-13 14:28:40 +06:00
Paul Brown b8b0cbb611 prevent KeyError: 'purelib' by removing INSTALLED_SCHEME hack from setup.py 2022-01-12 08:44:15 +06:00
pre-commit-ci[bot] 853b13f1d0 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.31.0)
2022-01-04 07:58:46 +06:00
Paul Brown 9c062bdca5
allow getting recoverable_connection_errors without an active transport (#1471)
* allow getting recoverable_connection_errors without an active transport

* move redis transport errors to class

* move consul transport errors to class

* move etcd transport errors to class

* remove redis.Transport._get_errors and references in tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix flake8 errors

* add integration test for redis ConnectionError

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-30 12:28:11 +06:00
Asif Saif Uddin b6b4408575 Bump version: 5.2.2 → 5.2.3 2021-12-29 10:58:03 +06:00
Asif Saif Uddin 242f6d5780 Changelog for v5.2.3 2021-12-29 10:52:51 +06:00
pre-commit-ci[bot] 921edc5ddc [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0)
2021-12-28 09:23:26 +06:00
Paul Brown 81ec90fbce
prevent redis event loop stopping on 'consumer: Cannot connect' (#1477)
* prevent redis event loop stopping on 'consumer: Cannot connect'

* fix flake8 errors

* simplify event pool polling started check
2021-12-25 10:24:08 +06:00
Mehdi Pourfar a9c4f9837c
respect connection timeout (#1458)
* pass timeout to ensure connection function

* test connection respect its timeout
2021-12-24 15:21:44 +06:00
Paul Brown 47781af050 prevent event loop polling on closed redis transports (and causing leak) 2021-12-24 09:25:47 +06:00
Paul Brown 507b306400
reduce memory usage of Transport (#1470)
* reduce memory usage of Transport

* fix flake8 errors

* move channel_id login into _get_free_channel_id
2021-12-23 20:41:30 +06:00
Asif Saif Uddin 4a6e1647b5
test amqp v5.0.9 (#1462)
* test amqp v5.0.8

* bump to 5.0.9 in an attempt to fix the regression

* try restrict setuptool in CI

* try pining setuptools (#1466)

* try pining setuptools

* try more lower version

* try 59.7.0

* try pin to setuptools==58.2.0

* try restrict setuptool in CI

* setuptools>=59.1.1,<59.7.0
2021-12-22 09:48:08 +06:00
Asif Saif Uddin 6ddf940940
try pining setuptools (#1466)
* try pining setuptools

* try more lower version

* try 59.7.0

* try pin to setuptools==58.2.0

* try restrict setuptool in CI

* setuptools>=59.1.1,<59.7.0
2021-12-22 09:25:33 +06:00
Asif Saif Uddin c4a8c2a69f try restrict setuptool in CI 2021-12-22 09:08:31 +06:00
Asif Saif Uddin b71b4215c9 test pyaqp v5.0.7 2021-12-13 17:27:11 +06:00
Matus Valo 58975b2a95
Ensure that restore is atomic in redis transport (#1444)
* Ensure that restore is atomic in redis transport

* Fix wrong variable

* Added integration tests

* Update unittests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix integration tests

* Fix flake8

* Fix queue name in int. tests

* Cosmetic clean up of integration tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-10 23:53:40 +01:00
n0061q 081e9e6cff
SQS transport: detect FIFO queue properly by checking queue URL (#1450)
* SQS: detect FIFO queue properly

* SQS: validate predefined queues

Co-authored-by: Yaroslav Litus <Yaroslav.Litus@F-Secure.com>
2021-12-03 09:46:41 +01:00
Asif Saif Uddin a2d7cfd8ae
tidelift action 2021-11-27 13:15:09 +06:00
Illia Volochii 40570a2860 Allow redis >= 4.0.2 2021-11-25 11:18:10 +06:00