From d24f19bcde056ad9e97938a6da1fdfd5fcabfb98 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 13 Jan 2014 16:32:35 +0000 Subject: [PATCH] Whitelist external packages * pypi_mirror/cmd/run_mirror.py: Use the --allow-external and --allow-insecure options so that pip 1.5 and later will assent to retrieve the netifaces, psutil, pysendfile and pytidylib packages even though they're not hosted on PyPI. The --allow-insecure option is aliased to a clearer --allow-unverified wording in 1.5, but the old form is being used to avoid breaking users of 1.4.x and will be valid at least through 1.6.x according to comments in the pip source. Change-Id: I43d276fd6d294f74fae6d7ef36ac38d27a53f14e --- pypi_mirror/cmd/run_mirror.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pypi_mirror/cmd/run_mirror.py b/pypi_mirror/cmd/run_mirror.py index fde87a6..3579c28 100644 --- a/pypi_mirror/cmd/run_mirror.py +++ b/pypi_mirror/cmd/run_mirror.py @@ -164,6 +164,10 @@ class Mirror(object): "%(pip)s install -U %(extra_args)s --exists-action=w" " --download-cache=%(download_cache)s" " --build %(build_dir)s -f %(find_links)s" + " --allow-external netifaces --allow-insecure netifaces" + " --allow-external psutil --allow-insecure psutil" + " --allow-external pysendfile --allow-insecure pysendfile" + " --allow-external pytidylib --allow-insecure pytidylib" " -r %(requirements_file)s") venv_format = ( "virtualenv --clear --extra-search-dir=%(extra_search_dir)s" @@ -171,13 +175,25 @@ class Mirror(object): upgrade_format = ( "%(pip)s install -U --exists-action=w" " --download-cache=%(download_cache)s --build %(build_dir)s" + " --allow-external netifaces --allow-insecure netifaces" + " --allow-external psutil --allow-insecure psutil" + " --allow-external pysendfile --allow-insecure pysendfile" + " --allow-external pytidylib --allow-insecure pytidylib" " -f %(find_links)s %(requirement)s") wheel_file_format = ( "%(pip)s wheel --download-cache=%(download_cache)s" " --wheel-dir %(wheel_dir)s -f %(find_links)s" + " --allow-external netifaces --allow-insecure netifaces" + " --allow-external psutil --allow-insecure psutil" + " --allow-external pysendfile --allow-insecure pysendfile" + " --allow-external pytidylib --allow-insecure pytidylib" " -r %(requirements_file)s") wheel_format = ( "%(pip)s wheel --download-cache=%(download_cache)s" + " --allow-external netifaces --allow-insecure netifaces" + " --allow-external psutil --allow-insecure psutil" + " --allow-external pysendfile --allow-insecure pysendfile" + " --allow-external pytidylib --allow-insecure pytidylib" " -f %(find_links)s --wheel-dir %(wheel_dir)s %(requirement)s") workdir = tempfile.mkdtemp()