Skip to content

Commit e5bc5aa

Browse files
authored
docs: clarify configuration source precedence (#10757)
Add a section to configuration docs that explains precedence among environment variables, local config, global config, and defaults.
1 parent 1ab7e4e commit e5bc5aa

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

docs/configuration.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ This also works for secret settings, like credentials:
119119
export POETRY_HTTP_BASIC_MY_REPOSITORY_PASSWORD=secret
120120
```
121121

122+
## Configuration sources
123+
124+
When a setting is set in multiple places, Poetry applies the following precedence
125+
(from highest to lowest):
126+
127+
1. Environment variables (for example, `POETRY_VIRTUALENVS_CREATE`)
128+
2. The local `poetry.toml` file (created with `poetry config --local`)
129+
3. The global `config.toml` file
130+
4. The setting's default value
131+
132+
For repository credentials (`http-basic.*`, `pypi-token.*`), Poetry may also read
133+
from `auth.toml` and the system keyring (for details see [Repositories]({{< relref "repositories" >}})).
134+
Environment variables still take precedence over file-based values.
135+
122136
## Migrate outdated configs
123137

124138
If Poetry renames or remove config options it might be necessary to migrate explicit set options. This is possible

0 commit comments

Comments
 (0)