`matrix_commander` erroneously depends on `matrix_chat`
It is currently not possible to enable matrix_commander
without enabling matrix_chat
:
# grouprisectl matrix_commander --log-level info
Traceback (most recent call last):
File "/usr/share/grouprise/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 224, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 36, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/share/grouprise/python-lib/grouprise/features/matrix_commander/management/commands/matrix_commander.py", line 10, in <module>
from grouprise.features.matrix_commander.matrix_bot import CommanderBot
File "/usr/share/grouprise/python-lib/grouprise/features/matrix_commander/matrix_bot.py", line 7, in <module>
from grouprise.features.matrix_chat.matrix_bot import MatrixBot
File "/usr/share/grouprise/python-lib/grouprise/features/matrix_chat/matrix_bot.py", line 16, in <module>
from .models import (
File "/usr/share/grouprise/python-lib/grouprise/features/matrix_chat/models.py", line 9, in <module>
class MatrixChatGroupRoom(models.Model):
File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 108, in __new__
raise RuntimeError(
RuntimeError: Model class grouprise.features.matrix_chat.models.MatrixChatGroupRoom doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
We should move the commonly used code (the MatrixBot
class) somewhere else (or at least avoid any model lookups while importing the class).
Probably there is nothing more to be done.