Feat/dynaconf
This MR moves us from standard yaml configs to using dynaconf.
Description
There are multiple neat features that could be implemented with Dynaconf, but for this MR I wanted to keep things as simple as possible, so I've done this with as few changes as I could.
The way the configurations are used is not changed, the only changes are:
- Webservice config files moved to a 'config' directory
- Configs loaded by
config/__init__.py
- Changed the config loading code to import configs from the module
- Configs are loaded from multiple places, in this order:
config/S.yaml
,config/.secret.S.yaml
,~/.config/pycalibration/S.yaml
,DYNACONF_S_*
env vars (whereS
is the service name, e.g.webservice
orserve_overview
How Has This Been Tested?
Checked that the configs, when accessed as a dictionary, are identical between the original and dynaconf version
Relevant Documents (optional)
-
todo
Types of changes
- New feature (non-breaking change which adds functionality)
- Docs (changes to the documentation)
Checklist:
-
My code follows the code style of this project. -
My change requires a change to the documentation. -
I have updated the documentation accordingly. -
I added tests where appropriate.
Reviewers
@calibration there are a few other changes I need to do, main one being to make the command line arguments work again (currently passing a config path does nothing), but apart from that this is ready for review
Closes https://git.xfel.eu/gitlab/calibration/planning/issues/22
Edited by Robert Rosca