Author ncoghlan
Recipients dstufft, ncoghlan, paul.moore
Date 2013-12-23.06:41:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387780868.34.0.410698465934.issue20053@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-12-23 06:41:08ncoghlansetrecipients: + ncoghlan, paul.moore, dstufft
2013-12-23 06:41:08ncoghlansetmessageid: <1387780868.34.0.410698465934.issue20053@psf.upfronthosting.co.za>
2013-12-23 06:41:08ncoghlanlinkissue20053 messages
2013-12-23 06:41:05ncoghlancreate