Skip to content

__init__.py is not reexporting its members #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sk- opened this issue Apr 22, 2025 · 0 comments
Open

__init__.py is not reexporting its members #703

sk- opened this issue Apr 22, 2025 · 0 comments

Comments

@sk-
Copy link

sk- commented Apr 22, 2025

Once #699 is fixed, we will still have some typing issues because __init__.py is not defining __all__ or reexporting the members. See https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport for more details.

Without this, mypy produces the following error:

error: Module "django_rq" does not explicitly export attribute "get_queue"  [attr-defined]

This can be solved by just adding to __init__.py the following code:

__all__ = [
  "enqueue",
  "get_connection",
  "get_queue",
  "get_scheduler"
  "get_worker",
  "job",
  "VERSION",
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant