-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix missing env var prefix in documentation #2284
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit hesitant when it comes to including external hotfixes because of the obvious reasons (keeping stuff up to date, missing dependabot alerts, etc.), but I think this could work as a temporary solution until, as you mentioned, this modification gets approved and merged in the designated package.
I was also wondering and currently still looking into this if it's possible to achieve this with the template (as it worked before?), but you've probably already looked into that.
Also, does this work for aliased fields? For example, the scheduler has a DEBUG
variable, but based on the submitted PR I can infer that this would always produce prefixed fields like SCHEDULER_DEBUG
and I'm not sure if that's correct and also loaded by pydantic-settings
as the expected environment variable.
After some reading and experimenting, I found out we can reach the |
In my experience maintainers rarely release new versions without merging open PRs or giving feedback.
I couldn't figure it out quickly. Given that the env_prefix is part of pydantic-settings, in my opinion settings-doc should also support that and it is the right place to fix this.
This is not correct, when there is an alias the alias is used as before. There are also unit tests in settings-doc for this.
You would also need to make sure that aliased fields don't get the prefix. It might be possible, but it would also be double work, because there is already a fix for settings-doc. And while we are dicussing this, everybody who goes to OpenKAT documentation gets the wrong information and potentially wastes a lot of time before figuring out that our documentation is currently just plain wrong. |
I forgot to mention the PR I opened, but it is radeklat/settings-doc#29 |
While you might experience that, nothing indicates that this holds the same for this project, since the project doesn't have any real contributors expect for the owner (see issues and PRs).
Agree, this should be part of
Shouldn't be too hard to apply conditional formatting in Jinja templates:
Agree, therefore we should quickly do something. Ultimately it comes down to whether we want a "corrupted" dependency tree or simply to use the template. I'll leave it up to you and @underdarknl |
Changes
Currently the environment variables in the documentation are wrong because they all miss the prefix. I think this is since we updated pydantic, pydantic-settings and settings-doc. I've fixed settings-doc to include the prefix, this PR changed settings-doc to my fork while we wait for the PR to be merged and a new version released to PyPI.
Checklist for code reviewers:
Copy-paste the checklist from the docs/source/templates folder into your comment.
Checklist for QA:
Copy-paste the checklist from the docs/source/templates folder into your comment.