Skip to content

Feat/dynaconf

Robert Rosca requested to merge feat/dynaconf into master

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:

  1. Webservice config files moved to a 'config' directory
  2. Configs loaded by config/__init__.py
  3. Changed the config loading code to import configs from the module
  4. Configs are loaded from multiple places, in this order: config/S.yaml, config/.secret.S.yaml, ~/.config/pycalibration/S.yaml, DYNACONF_S_* env vars (where S is the service name, e.g. webservice or serve_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

Merge request reports