diff --git a/.deepsource.toml b/.deepsource.toml new file mode 100644 index 00000000..def09e24 --- /dev/null +++ b/.deepsource.toml @@ -0,0 +1,12 @@ +version = 1 + +test_patterns = ["tests/**"] + +exclude_patterns = ["examples/**"] + +[[analyzers]] +name = "python" +enabled = true + + [analyzers.meta] + runtime_version = "3.x.x" \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 537813fb..bba9d9a4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include LICENSE +include *.toml recursive-exclude tests * diff --git a/rq/cli/helpers.py b/rq/cli/helpers.py index d27fbb08..8d3357cb 100644 --- a/rq/cli/helpers.py +++ b/rq/cli/helpers.py @@ -143,7 +143,7 @@ def show_workers(queues, raw, by_queue, queue_class, worker_class): queue_dict[queue] = worker_class.all(queue=queue) if queue_dict: - max_length = max([len(q.name) for q, in queue_dict.keys()]) + max_length = max(len(q.name) for q, in queue_dict.keys()) else: max_length = 0 diff --git a/rq/scheduler.py b/rq/scheduler.py index f269ea9b..cc1b999b 100644 --- a/rq/scheduler.py +++ b/rq/scheduler.py @@ -40,7 +40,7 @@ class RQScheduler(object): def __init__(self, queues, connection, interval=1): self._queue_names = set(parse_names(queues)) - self._acquired_locks = set([]) + self._acquired_locks = set() self._scheduled_job_registries = [] self.lock_acquisition_time = None self.connection = connection @@ -68,7 +68,7 @@ class RQScheduler(object): def acquire_locks(self, auto_start=False): """Returns names of queue it successfully acquires lock on""" - successful_locks = set([]) + successful_locks = set() pid = os.getpid() logging.info("Trying to acquire locks for %s", ", ".join(self._queue_names)) for name in self._queue_names: