feat: change config file format to yaml
- docs: add link to yaml.org BREAKING: The `ini` configuration file format changed to `yml`. Please rewrite your configuration file using the yaml format.
This commit is contained in:
parent
5d902ef962
commit
e4439390fe
11 changed files with 121 additions and 139 deletions
|
@ -1,5 +1,4 @@
|
|||
import sys
|
||||
from configparser import ConfigParser
|
||||
from os import environ
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
@ -96,13 +95,6 @@ class BaseConfig(BaseModel):
|
|||
logger.warning(f"provided config filepath '{filepath}' is not a file")
|
||||
return {}
|
||||
|
||||
# pylint: disable=fixme
|
||||
# TODO: Remove ability to load ini files once yaml if fully supported.
|
||||
if filepath.suffix == ".conf":
|
||||
config = ConfigParser()
|
||||
config.read_string(filepath.read_text(encoding="utf-8"))
|
||||
return {s: dict(config.items(s)) for s in config.sections()}
|
||||
|
||||
try:
|
||||
return safe_load(filepath.read_text(encoding="utf-8"))
|
||||
except YAMLError as error:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue