2020-11-16 02:00:43 +03:00
|
|
|
"""Containers module."""
|
|
|
|
|
|
|
|
from dependency_injector import containers, providers
|
|
|
|
from github import Github
|
|
|
|
|
|
|
|
from . import services
|
|
|
|
|
|
|
|
|
|
|
|
class Container(containers.DeclarativeContainer):
|
|
|
|
|
2021-11-01 03:31:39 +03:00
|
|
|
wiring_config = containers.WiringConfiguration(packages=[".blueprints"])
|
|
|
|
|
|
|
|
config = providers.Configuration(yaml_files=["config.yml"])
|
2020-11-16 02:00:43 +03:00
|
|
|
|
|
|
|
github_client = providers.Factory(
|
|
|
|
Github,
|
|
|
|
login_or_token=config.github.auth_token,
|
|
|
|
timeout=config.github.request_timeout,
|
|
|
|
)
|
|
|
|
|
|
|
|
search_service = providers.Factory(
|
|
|
|
services.SearchService,
|
|
|
|
github_client=github_client,
|
|
|
|
)
|