-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add a mechanism to have a config file that can be overriden by user config #11851
Comments
I don’t think this makes much sense, since the user can override that environment variable directly instead. Perhaps it is better to add a mechanism for a config file to “inherit” another config file. |
We've added an interepreter level configuration option (#11487) for precisely this usecase. |
I think #9752 covers this. |
But that mechanism overrides user config. |
The idea of environment modules is that you do something like |
Yes, you are right. The order of The processing order is one of the reasons I wished to be able to control the processing order. I prototyped being able to configure the precedence, e.g.
Which would do a first pass to compute the As you pointed out in #11815 the |
What's the problem this feature will solve?
Right now the only way to specify a config file that a user can override is to use the global config file which a user needs root to create. This is difficult for shared systems where non-administrators provide Python support.
Describe the solution you'd like
I suggest adding an environment variable along the lines of
PIP_DEFAULT_CONFIG_FILE
which is loaded first and overriden by all other config files. The major downside to this approach is that it will be a little hard to document/could lead to confusing or messy documentation.Alternative Solutions
It is pretty standard notion to have configs like
global < user < project-level < env vars
. pip somewhat breaks this with the waysite
andbase
work. The idea ofsite
is that a virtualenv config is basically like the project-level config. Unfortunately, when pip is not being used in a virtual environment, this sort of breaks the above as then we have something that is like a global config overriding user configs. But, this behaviour is probably unchangeable at this point, otherwise a file location somewhere next to the Python install might be ideal. As it is, no other location make sense, which basically only leaves an environment variable.Additional context
To clarify slightly the situation, we have a group of users who are not admins that manage our python installs where I work. These versions of python are installed in "non-standard" locations and are made available to users via environment modules. Additionally, we have internal PyPI mirrors and other config we'd like to make available to users as a default, but enable them to override. There's not really a mechanism to do this currently.
Note I'm happy to make a PR for this if there's support for adding this feature.
Code of Conduct
The text was updated successfully, but these errors were encountered: