New submission from Nick Coghlan:

In resolving issue 19734, I realised venv and ensurepip are actually in a 
similar situation with respect to the default pip configuration file as they 
were with respect to environment variables: those settings are unlikely to be 
appropriate for ensurepip, but pip will still pay attention to them during the 
bootstrapping process.

However, it's a bit trickier to test, since PIP_CONFIG_FILE will be ignored 
(due to the resolution of issue 19734).

The approach I will run with (if nobody has any better suggestions):

- create a temporary directory
- set os.environ["HOME"] to point to that directory
- create a platform appropriate file (pip\pip.ini on Windows, .pip/pip.conf 
elsewhere) containing the settings:

    [global]
    no-install=1

That should cause the test_venv tests to fail, just as setting PIP_NO_INSTALL 
in the environment caused them to fail as a test for the issue 19734 resolution.

In terms of forcing pip to *ignore* the global config file, the best option I 
have found is setting PIP_CONFIG_FILE=/dev/null (I believe the Windows 
equivalent would be PIP_CONFIG_FILE=NUL). The fact the file exists means pip 
uses it without falling back to the default file location, while the fact it is 
always read as empty means it has no effect on pip's operation.

I'm open to better suggestions on how to do that, but it seems like the best 
available option without an "isolated mode" equivalent in pip.

----------
assignee: ncoghlan
messages: 206843
nosy: dstufft, ncoghlan, pmoore
priority: normal
severity: normal
status: open
title: venv and ensurepip are affected by default pip config file
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20053>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to