Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to pydantic in settings management #326

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

adamjanovsky
Copy link
Collaborator

@adamjanovsky adamjanovsky commented Mar 29, 2023

Management of global configuration variable is now left to Pydantic. This means:

  • No json schema, this is replaced by Pydantic specification
  • Description of default values and types is now accessible from docs, not from the example yaml
    • The docs no longer show the configuration keys twice 馃檭
  • No default settings.yml is needed anymore, the default values are stored in the class
  • One can define new settings files just by overriding some keys, see test settings e.g. where only a single key is overriden.
  • One can set keys with environment variables -- handy for secerts
  • Some old keys got deleted, some sensible integer boundaries on existing keys were introduced
  • I wrote some tests to check that new config works properly

@adamjanovsky adamjanovsky requested a review from J08nY March 29, 2023 14:34
@adamjanovsky
Copy link
Collaborator Author

adamjanovsky commented Mar 29, 2023

@J08nY could you please briefly check this? If you build docs, the page configuration.html contains more elaborated description on how to work with the configuration, but little has changed.

I say we don't add support for loading secrets from files. Environment variables should be ok for now, right?

Copy link
Member

@J08nY J08nY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@adamjanovsky adamjanovsky merged commit c0dc17e into main Mar 30, 2023
@adamjanovsky adamjanovsky deleted the pydantic-settings-management branch March 30, 2023 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants