Skip to content

Commit

Permalink
Issue #112 introduce get_backend_config for AggregatorBackendConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Feb 7, 2024
1 parent c7a095b commit 0615689
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"requests",
"attrs",
"openeo>=0.27.0",
"openeo_driver>=0.81.0.dev",
"openeo_driver>=0.86.0.dev",
"flask~=2.0",
"gunicorn~=20.0",
"python-json-logger>=2.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/openeo_aggregator/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def create_app(config: Any = None, auto_logging_setup: bool = True) -> flask.Fla

log_version_info(logger=_log)

# TODO #112 move this default to the AggregatorBackendConfig getter (get_backend_config)
os.environ.setdefault(ConfigGetter.OPENEO_BACKEND_CONFIG, str(get_config_dir() / "backend_config.py"))

config: AggregatorConfig = get_config(config)
Expand Down
8 changes: 7 additions & 1 deletion src/openeo_aggregator/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import logging
import os
from pathlib import Path
from typing import List, Union
from typing import Callable, List, Union

import attrs
from openeo_driver.config import OpenEoBackendConfig
from openeo_driver.config.load import ConfigGetter
from openeo_driver.server import build_backend_deploy_metadata
from openeo_driver.users.oidc import OidcProvider
from openeo_driver.utils import dict_item
Expand Down Expand Up @@ -133,3 +134,8 @@ class AggregatorBackendConfig(OpenEoBackendConfig):
capabilities_deploy_metadata: dict = build_backend_deploy_metadata(
packages=["openeo", "openeo_driver", "openeo_aggregator"],
)


_config_getter = ConfigGetter(expected_class=AggregatorBackendConfig)

get_backend_config: Callable[..., AggregatorBackendConfig] = _config_getter.get

0 comments on commit 0615689

Please sign in to comment.