docs: clarify configuration source precedence#10757
docs: clarify configuration source precedence#10757mitre88 wants to merge 1 commit intopython-poetry:mainfrom
Conversation
Add a section to configuration docs that explains precedence among environment variables, local config, global config, and defaults.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideDocuments configuration source precedence in configuration.md, explicitly listing the order of precedence across environment variables, local and global configuration files, and defaults, and clarifies how repository credentials interact with auth.toml and the system keyring. Flow diagram for configuration source precedence lookupflowchart TD
A[Start configuration lookup] --> B{Is environment variable set?}
B -- Yes --> C[Use environment variable value]
B -- No --> D{Is value set in local poetry.toml?}
D -- Yes --> E[Use local poetry.toml value]
D -- No --> F{Is value set in global config.toml?}
F -- Yes --> G[Use global config.toml value]
F -- No --> H[Use default value]
subgraph Credentials_sources
I[Repository credentials setting<br/>http-basic.* or pypi-token.*] --> J{Is environment variable set?}
J -- Yes --> K[Use environment variable value]
J -- No --> L{Is value in auth.toml or keyring?}
L -- Yes --> M[Use auth.toml or keyring value]
L -- No --> N[Fall back to other configuration sources<br/>or default]
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider clarifying the relative precedence between
auth.toml, the system keyring, and the regular config files so readers understand the complete ordering for credential lookup, not just that env vars win over file-based values. - It may be helpful to explicitly link or refer back to the earlier note about local vs global configuration precedence so readers don’t have to infer how that section aligns with the new, more detailed precedence list.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider clarifying the relative precedence between `auth.toml`, the system keyring, and the regular config files so readers understand the complete ordering for credential lookup, not just that env vars win over file-based values.
- It may be helpful to explicitly link or refer back to the earlier note about local vs global configuration precedence so readers don’t have to infer how that section aligns with the new, more detailed precedence list.
## Individual Comments
### Comment 1
<location path="docs/configuration.md" line_range="58" />
<code_context>
+precedence over file-based values.
+
{{% warning %}}
Be mindful when checking in this file into your repository since it may contain user-specific or sensitive information.
{{% /warning %}}
</code_context>
<issue_to_address>
**issue (typo):** Consider fixing the grammar in this sentence by removing the extra "in".
The current wording is a bit awkward. Consider either "checking this file into your repository" or "checking in this file to your repository" to avoid the duplicated preposition.
```suggestion
Be mindful when checking this file into your repository since it may contain user-specific or sensitive information.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| precedence over file-based values. | ||
|
|
||
| {{% warning %}} | ||
| Be mindful when checking in this file into your repository since it may contain user-specific or sensitive information. |
There was a problem hiding this comment.
issue (typo): Consider fixing the grammar in this sentence by removing the extra "in".
The current wording is a bit awkward. Consider either "checking this file into your repository" or "checking in this file to your repository" to avoid the duplicated preposition.
| Be mindful when checking in this file into your repository since it may contain user-specific or sensitive information. | |
| Be mindful when checking this file into your repository since it may contain user-specific or sensitive information. |
| the local/project configuration takes precedence over the global configuration. | ||
| {{% /note %}} | ||
|
|
||
| ## Configuration sources |
There was a problem hiding this comment.
I wonder if this section should be placed after "Using environment variables" because here environment variables were not even introduced.
By the way, the section is placed in the middle of another section at the moment. The warning that follows belongs to "Local configuration".
| 4. The setting's default value | ||
|
|
||
| For repository credentials (`http-basic.*`, `pypi-token.*`), Poetry may also read | ||
| from `auth.toml` and the system keyring. Environment variables still take |
There was a problem hiding this comment.
We should add a link to where this is explained like:
| from `auth.toml` and the system keyring. Environment variables still take | |
| from `auth.toml` and the system keyring - for details see <link>. Environment variables still take |
Summary
docs/configuration.md.auth.tomland keyring, while environment variables still override file-based values.Resolves: #5029
Summary by Sourcery
Clarify configuration source precedence and credential lookup behavior in the configuration documentation.
Documentation: