move runner_dict to its own file to prevent circular import

This commit is contained in:
Daniel 2023-12-04 15:40:28 +01:00
parent eb0714da9b
commit 87126ef254
3 changed files with 18 additions and 12 deletions

View file

@ -5,7 +5,8 @@ from loguru import logger
from src.dir_manager import DirManager
from src.env_manager import EnvFile, EnvManager
from src.html_helper import merge_html_files
from src.runner import RUNNER_DICT, Runner
from src.runner import Runner
from src.runner_dict import RUNNER_DICT
from src.utils import rmtree

View file

@ -7,17 +7,6 @@ from dotenv import dotenv_values
from loguru import logger
from src.dir_manager import DirManager
from src.tests_authentik.runner_authentik import RunnerAuthentik
from src.tests_nextcloud.runner_nextcloud import RunnerNextcloud
from src.tests_wordpress.runner_wordpress import RunnerWordpress
# Register all runners here. Each .env file with TYPE=authentik will be run with RunnerAuthentik
RUNNER_DICT: dict[str, type["Runner"]] = {
"authentik": RunnerAuthentik,
"wordpress": RunnerWordpress,
"nextcloud": RunnerNextcloud,
}
@dataclass

16
src/runner_dict.py Normal file
View file

@ -0,0 +1,16 @@
from typing import TYPE_CHECKING
from src.tests_authentik.runner_authentik import RunnerAuthentik
from src.tests_nextcloud.runner_nextcloud import RunnerNextcloud
from src.tests_wordpress.runner_wordpress import RunnerWordpress
if TYPE_CHECKING:
from src.runner import Runner
# Register all runners here. Each .env file with TYPE=authentik will be run with RunnerAuthentik
RUNNER_DICT: dict[str, type["Runner"]] = {
"authentik": RunnerAuthentik,
"wordpress": RunnerWordpress,
"nextcloud": RunnerNextcloud,
}