From 2faba2cea9bb23e635bd067c85ecabd7fdd22cce Mon Sep 17 00:00:00 2001 From: Dominik Aumayr Date: Wed, 7 Jun 2023 05:11:15 +0200 Subject: [PATCH] Add __all__ to please mypy (#1928) * Add __all__ to please mypy mypy complains with "implicit reexport disabled" when importing directly from the main `rq` package, eg. from rq import Worker Without adding an `__all__` to `__init__.py`, mypy would expect it this way: from rq.worker import Worker This PR does add the `__all__` to `__init__.py` to please mypy. * Lint --- rq/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rq/__init__.py b/rq/__init__.py index b385e76..96b4f40 100644 --- a/rq/__init__.py +++ b/rq/__init__.py @@ -5,4 +5,19 @@ from .queue import Queue from .version import VERSION from .worker import SimpleWorker, Worker +__all__ = [ + "Connection", + "get_current_connection", + "pop_connection", + "push_connection", + "Callback", + "Retry", + "cancel_job", + "get_current_job", + "requeue_job", + "Queue", + "SimpleWorker", + "Worker", +] + __version__ = VERSION