fix dependency types

This commit is contained in:
Daniel 2023-12-05 17:04:58 +01:00
parent f0bf98f613
commit eee64f4542
3 changed files with 15 additions and 9 deletions

View file

@ -6,6 +6,7 @@ from dotenv import dotenv_values
from src.dir_manager import DirManager
from src.runner_dict import RUNNER_DICT
from src.runner_manager import RunnerManager
class EnvFile(NamedTuple):
@ -25,6 +26,7 @@ class DependencyRule(NamedTuple):
class EnvManager:
def __init__(self, env_paths_list: list[Path]):
self.env_files: list[EnvFile] = self._get_env_files(env_paths_list)
self.runner_manager = RunnerManager(self.env_files)
self.dependency_rules: list[DependencyRule] = self._get_dependency_rules(self.env_files)
self.env_files = self.sort_env_files_by_rule(self.env_files, self.dependency_rules)
@ -46,7 +48,7 @@ class EnvManager:
for env_file in env_files:
child_runner_class = RUNNER_DICT[env_file.env_type]
for dependency in child_runner_class.dependencies:
dependency_rule = DependencyRule(child=child_runner_class.name, dependency=dependency.name)
dependency_rule = DependencyRule(child=child_runner_class.name, dependency=dependency)
dependency_rules.append(dependency_rule)
return dependency_rules