-
-
Notifications
You must be signed in to change notification settings - Fork 70
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyprojectTomlConfigSettingsSource overwrite toml_file
Path from model_config
#413
Comments
toml_file_path
from model_config
toml_file
Path from model_config
Thanks @sbrugman for reporting this issue. Yeah, the BTW, I would suggest defining a new config for I would suggest defining Would you like to work on it? |
Thanks for the swift reply. Indeed, I'm not able to contribute the feature soon, so if anyone is interested in working on it that would be much appreciated :) |
I did not get the idea of configurable
@hramezani I think this is existing feature and also is elaborated carefully in the doc already. |
Thanks @braindevices I agree this exists already. |
To use pydantic for handling
pyproject.toml
configuration, I would like to be able to pass a custom path to thePyprojectTomlConfigSettingsSource
. This is possible for theTomlConfigSettingsSource
source, but that lacks thepyproject.toml
support (very minor layer to get thetool.my-tool
section of the Toml file. ForPyprojectTomlConfigSettingsSource
, thesettings_cls.model_config.get('toml_file')
lookup is missing.toml_file
is ignored:toml_file
is respected:It looks like a fairly simple and straight-forward enhancement in
sources.py
.My current workaround is to create a custom class with elements of both classes:
Would be great if this functionality can come out-of-the-box.
The text was updated successfully, but these errors were encountered: