builder.braak.pro/buildbot/config/conf/worker.py
Bart van der Braak edb56e96dc
Some checks failed
/ checks (pull_request) Failing after 14s
Implement authentication via Gitea
2024-11-20 23:59:35 +01:00

37 lines
1 KiB
Python

# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2011-2024 Blender Authors
# <pep8 compliant>
import importlib
from typing import Any
def get_config(environment: str) -> Any:
if environment == "LOCAL":
import conf.local.worker
importlib.reload(conf.local.worker)
return conf.local.worker
else:
import conf.production.worker
importlib.reload(conf.production.worker)
return conf.production.worker
# Maybe useful in the future.
#
# import pathlib
# import importlib.util
#
# def _load_module_config(path: pathlib.Path) -> Any:
# filepath = pathlib.Path(__file__).parent / path
# spec = importlib.util.spec_from_file_location("config_module", filepath)
# if not spec:
# raise BaseException("Failed to load config module spec")
# config_module = importlib.util.module_from_spec(spec)
# if not spec.loader:
# raise BaseException("Failed to load config module spec loader")
# spec.loader.exec_module(config_module)
# return config_module