Add YAML settings#104
Merged
Merged
Conversation
Collaborator
There was a problem hiding this comment.
Pull request overview
This PR introduces YAML-based settings files into Wirio’s settings system, updating defaults, documentation, and tests accordingly, and extracting the JSON “flattening” parser into an internal module reused by the YAML provider.
Changes:
- Add
YamlSettingsProvider/YamlSettingsSourceand make YAML files the default settings file format (settings.yaml,settings.{environment}.yaml). - Extract the settings-file “flattening” logic into
wirio.settings._json._json_settings_file_parser. - Update tests and documentation to reflect YAML usage and add
PyYAMLas a dependency.
Reviewed changes
Copilot reviewed 9 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds pyyaml to the locked dependency set. |
| pyproject.toml | Adds PyYAML as a runtime dependency. |
| src/wirio/settings/settings_manager.py | Switches default providers and public API toward YAML (add_yaml_file, add_default_providers). |
| src/wirio/settings/yaml/yaml_settings_provider.py | Implements YAML file loading via yaml.safe_load and flattens values into settings keys. |
| src/wirio/settings/yaml/yaml_settings_source.py | Builds a YAML settings provider for the manager. |
| src/wirio/settings/_json/_json_settings_file_parser.py | New internal parser that flattens nested structures into :-delimited keys. |
| src/wirio/settings/_json/init.py | Adds internal package marker for the JSON parser. |
| src/wirio/settings/aws_secrets_manager/aws_secrets_manager_settings_provider.py | Updates import to use the new internal JSON parser module. |
| tests/settings/yaml/test_yaml_settings_provider.py | Replaces JSON provider tests with YAML provider tests and adds empty-file behavior. |
| tests/settings/yaml/init.py | Adds test package marker for YAML settings tests. |
| tests/settings/test_settings_manager.py | Updates default-provider expectations from JSON to YAML and adjusts method name patching. |
| tests/settings/json/test_json_settings_file_parser.py | Updates test import path to the extracted internal JSON parser. |
| docs/pages/core-concepts/settings.md | Updates docs to describe YAML defaults and YAML examples. |
Comments suppressed due to low confidence (1)
tests/settings/yaml/test_yaml_settings_provider.py:136
notes_2is added to the model and included in the YAML input, but the test never asserts the parsed value. Adding an assertion here would ensure null/empty YAML scalars are handled as expected for optional fields.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.