From 44c2fae80571a6bd4798a69262cb7a5d80f1584c Mon Sep 17 00:00:00 2001 From: chrisalbright Date: Wed, 30 Oct 2013 17:27:02 -0700 Subject: [PATCH] pip module: fix unexpected behavior when creating virtualenvs This module supports `virtualenv_site_packages` as an option to control whether or not to include system packages when installing pip packages into a virtual environment. The default is no, and when you say yes it explicitly it includes a flag to include site packages, otherwise it doesn't provide a flag. Some versions of virtualenv by default include site packages and other versions by default do not. This patch just makes both branches explicit, so `virtualenv_site_packages=no` really means no. --- library/packaging/pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/packaging/pip b/library/packaging/pip index 2b03a73207b..7f293c5c024 100644 --- a/library/packaging/pip +++ b/library/packaging/pip @@ -247,7 +247,7 @@ def main(): if module.params['virtualenv_site_packages']: cmd = '%s --system-site-packages %s' % (virtualenv, env) else: - cmd = '%s %s' % (virtualenv, env) + cmd = '%s --no-site-packages %s' % (virtualenv, env) os.chdir(tempfile.gettempdir()) if chdir: os.chdir(chdir)