* Update linting configuration
This removes flake8 in favor of ruff, which also provides isort support, and
updates all files to be black, isort, and ruff compliant. This also adds black
and ruff checks to the tox and Github linting workflow.
* Tweak the code coverage config and calls
As `redis-py` in version 3.5.0 is now required, whoch only support
Python 3.5+, we should remove Python 3.4 from the supported Python
versions as well.
Signed-off-by: Paul Spooren <mail@aparcar.org>
* setup: read requirements.txt for dependencies
This makes it easier to keep required packages in sync.
Signed-off-by: Paul Spooren <mail@aparcar.org>
* requirements: Update to click 5.0 and redis 3.5.0
Click 5.0 was already required by the `setup.py` and is not brought in
sync. Redis Python library 3.5.0 introduces the `HSET` command with
mapping support which replaces the previous `hmset`. By lifting the
minimal required version to 3.5.0 we can remove the combat function if
Redis server 4.0 is guaranteed.
Signed-off-by: Paul Spooren <mail@aparcar.org>
* ci: remove Python3.4 testing
`redis-py` 3.5.0 does no longer support Python 3.4, so drop it in CI.
Signed-off-by: Paul Spooren <mail@aparcar.org>
* modify zadd calls for redis-py 3.0
redis-py 3.0 changes the zadd interface that accepts a single
mapping argument that is expected to be a dict.
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd
* change FailedQueue.push_job_id to always push a str
redis-py 3.0 does not attempt to cast values to str and is left
to the user.
* remove Redis connection patching
Since in redis-py 3.0, Redis == StrictRedis class, we no longer
need to patch _zadd and other methods.
Ref: https://github.com/rq/rq/pull/1016#issuecomment-441010847
* Replaced async keyword with is_async in the Queue class to fix reserved keyword syntax errors in Python 3.7
* Updated tests to use is_async keyword when instantiating Queue objects
* Updated docs to reference is_async keyword for Queue objects
* Updated tox.ini, setup.py and .travis.yml with references to Python 3.7
A few things have changed. First of all, there is no separate copy of
the argparse-based `rqinfo` anymore. It now fully utilizes the new
Click subcommand. In other words: `rqinfo` and `rq info` both invoke
the same function under the hood.
In order to support this, the main command group now does NOT take
a `url` option and initializes the connection. Besides supporting this
alias pattern, this change was useful for two more reasons: (1) it
allows us to add subcommands that don't need the Redis server running in
the future, and (2) it makes the `--url` option an option underneath
each subcommand. This avoids command invocations that look like this:
$ rq --url <url> info --more --flags
And instead allows us to pass the URL to each subcommand where it's
deemed necessary:
$ rq info --url <url> --more --flags
Which is much friendlier to use/remember.
Pull request nvie/rq#192 solved the issue for `pip install rq` but not when
directly installing from a git repository as in
`pip install git+git://github.com/nvie/rq@master` that still creates a
possibly conflicting `tests` folder.
redis-py now supports URL-based connection configuration. When --url
is specified, we use it to construct the Redis object. Otherwise, we
use the existing argument-based construction method.
`Redis.from_url()` is new in redis-py 2.6.2, so that prerequisite has
been adjusted accordingly.
This reverts commit 1ab8c19696 and
reintroduces all changes made by @dstufft.
Still, it needs more patches to reeanble the default log-to-console
behaviour. See #121.
Unfortunately zc.buildout does not support distribute/setuptools script
option (see https://bugs.launchpad.net/zc.buildout/+bug/422724), but it
does support console_scripts. This also makes the scripts importable,
allowing for unittest and code reuse.
This aids unpacking in the case of a function that isn't importable from
the worker's runtime. The unpickling will now (almost) always succeed,
and throw an ImportError later on, when the function is actually
accessed (thus imported implicitly).
The end result is a job on the failed queue, with exc_info describing
the import error, which is tremendously useful.