-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(merge): Merge branch 'release/v2' into 'feature/keep-yaml-data'
- Loading branch information
Showing
5 changed files
with
51 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ maintainers = [ | |
"Helio Chissini de Castro <[email protected]>" | ||
] | ||
name = "yaml-settings-pydantic" | ||
version = "2.3.1" | ||
version = "2.3.2" | ||
description = "A tool to easily load (many) JSON/YAML files as pydantic settings." | ||
readme = "README.rst" | ||
keywords = [ | ||
|
@@ -197,7 +197,7 @@ pytest-mypy = "^0.10.3" | |
|
||
|
||
[tool.bumpver] | ||
current_version = "2.3.1" | ||
current_version = "2.3.2" | ||
version_pattern = "MAJOR.MINOR.PATCH" | ||
commit_message = "chore(version): Bump version {old_version} -> {new_version}" | ||
commit = true | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
whatever: | ||
the: heck | ||
should: be | ||
here: dude | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from yaml_settings_pydantic import ( | ||
BaseYamlSettings, | ||
YamlFileConfigDict, | ||
YamlSettingsConfigDict, | ||
) | ||
|
||
WHATEVER = Path(__file__).parent / "extra" / "whatever.yaml" | ||
|
||
|
||
def test_yaml_files_dict_string_keys() -> None: | ||
"""For now, make sure that this does not fail.""" | ||
|
||
class Settings(BaseYamlSettings): | ||
the: str | ||
should: str | ||
here: str | ||
|
||
model_config = YamlSettingsConfigDict( | ||
yaml_files={ | ||
WHATEVER: YamlFileConfigDict( | ||
subpath="whatever", | ||
required=True, | ||
) | ||
} | ||
) | ||
|
||
settings = Settings.model_validate({}) | ||
assert settings.the == "heck" | ||
assert settings.should == "be" | ||
assert settings.here == "dude" |
This file contains 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
This file contains 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