Skip to content

PIP_CONFIG_FILE overrides other configs in conflict with documentation #11815

@dalebrydon

Description

@dalebrydon

Description

When PIP_CONFIG_FILE is set, values in that file override other files. However in the documentation it states:

Additionally, the environment variable PIP_CONFIG_FILE can be used to specify a configuration file that’s loaded first, and whose values are overridden by the values set in the aforementioned files.

I presume that the intended functionality is what is described in the documentation, especially since there is a comment to that effect in Configuration.iter_config_files. (Namely, # environment variables have the lowest priority.) However, given the length of time things have been this way, maybe the docs are what's wrong.

The actual functionality is determined by override order, where kinds.ENV is the second highest priority. I think having the order specified in two different places is the ultimate source of the bug.

Happy to submit a PR once there's some clarity on what the right way to fix it is.

Expected behavior

No response

pip version

all

Python version

3

OS

any

How to Reproduce

Have any (global, user, site) pip.conf in a standard path and run > PIP_CONFIG_FILE=/path/to/any/other/pip.conf pip config debug

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behaviortype: docsDocumentation related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions