upgrade pip

This commit is contained in:
Andreas Billmeier 2019-02-17 09:29:51 +01:00
parent a1bd6c0f4e
commit 2141bbc640
14 changed files with 459 additions and 0 deletions

18
dev-python/pip/Manifest Normal file
View File

@ -0,0 +1,18 @@
AUX pip-10.0.1-disable-system-install.patch 769 BLAKE2B 9e722c95f01a184bbc48df6979cde15d748311e5ee5d83e5d18659cffd7520145bb24af891ba0f760dcec4c17b17d31adf211f1a4f938598d1fec44be56e6891 SHA512 6b0d49d398940f2614b2a892be2169a6c2c2d26d7d700271df3819c71c284646cceac9dce4e907662690e17bc0ca372b6251e02f520bf3e60994b26725403029
AUX pip-10.0.1-disable-version-check.patch 850 BLAKE2B 4ec0e8e0b172c51cdfa2df6ee934df8e25a03885ef7976c2f7cc844728e0359a1d5081296680576ea5780a15b639b3809063e663374ee11e252cd95bd9e876ae SHA512 b489eaf4fe17042807dd92ce77b016fcd032dd79bd5c766bdf9be38d2958e32400bdb5950ff2c400abac42d2a0a17803f5a2cfdc1161906c95c1d34a8bc83f8a
AUX pip-6.0.2-disable-version-check.patch 465 BLAKE2B e3ae94267a8d0caf425d22968f6e640063eaca0d2c475d130d1d2f7281d6ef541c0c36c3871c67fd4947f54a4ca18cc9a9c0fa347a3960727483b3a3bcd46ed9 SHA512 fd3413fea4649aa6a34ff7a23e7442267dc07307aeb25398e4620d108ab144703db7431e2a158612d9ee67e448d1d66db7e8103364aa6635844672bea16c7d28
AUX pip-7.1.2-unbundle.patch 1496 BLAKE2B f0bb71125270bbcfe1fe544b81130951c6ccdb97f676b3be5c7831efdedae5edbc47669836565b269af287910cd23cbc193037b39ac09dcaff5dceee542c32e7 SHA512 c0daf49d9a596a188fd54751b8ee7333f1c3187657b677a6f61ab9820483b388c3475b5fecb887115aaa34208070a15b56a8eb5e0a4639c3732840cf17a6f16a
AUX pip-8.0.0-unbundle.patch 1985 BLAKE2B dca355b40941ef5f805a4b247d75dc9d2ad560c7fd9752be2ca1d428522e83a4c318d3d361d2960fce79051df2ea9180a48c23e4af3048fe31ac535cd0cb8db9 SHA512 3b5f96160623eb2fad9c5978fc6512b21d48d5b91cb09c9d43deaee6de3c843af137a5df11c83b0d8395625482162d8cf40748b072692b305d6ab1220f3fb0c6
AUX pip-9.0.1-disable-version-check.patch 1031 BLAKE2B 148e528aab19de021f193ac56d758c803e0875b618ee32e948eb103eb6b05eb56e2ecf5ed4dbe39893f5c44ddee17122fdd686f433f5ce89044b2c02291e0ba1 SHA512 8b5764d3ecdbfc871bdf051b41d9610d5028bc3b95a4bf990db46325d10e5d559449ec97ab052686148d6ab6abfa630fb38101c726b6648d19fa94ac593b0a28
AUX pip-disable-system-install.patch 1070 BLAKE2B 85bfd82888a169cf771467f4f811b9859fddc1cfd134ac21be42b9fd93d84118354fa23a2f4b0ec9c67024f571ba7035665302671420221b52f3fc89f24b1af3 SHA512 bb0a9a32b2eac0a12276c3f0527534226c03868300f54945d20eec16902ad51cbfdace9d79b0caa304bc641323194031a5ca9e5e784366a44527441bd0f3c231
DIST pip-18.0.tar.gz 1249656 BLAKE2B 064b5c1db52984414383290bd4c35621f3b2662db0c21391cc8fafa0f36e0ab2b47f41726213a9eaa6f8a25b748004c0c06295855a370017bd588f7f843492ee SHA512 51b8708756a8cbe5ca284fa09908d4acf1127493e4b645f2756ae55e4afd5dec619a017cedb695a044aa24a377909810a1caea4242bb3dc475bfe3435fcaa1bc
DIST pip-18.1.tar.gz 1259370 BLAKE2B b349ed8159ea060bb0fee64e310dc56f899bfda082fc790dce693f49a52a2d02ac9ee1966102f5469e3da251cfa3c10540d9f149c63cb09fe0ff0882c0bdec72 SHA512 f13c129675f2de7f8bc10cfd0d49fc5c650cf59825282c3311c15841bca904604fe78a28d9b48f1c8fa4486826ac3d7d7362cec7a4631715b71b0928b48fff1d
DIST pip-19.0.1.tar.gz 1321875 BLAKE2B 6a90dcd0cea278e452f518a5737240aa1128f9ac30a3abdd0745d8f11663a6ae4b27a1cfdaa35e3b69ac89c24d5d690c2541974b580d3f86aa84feb4dda56f80 SHA512 9d2d64170e020f8643ec0b4ff1dc727c343ff6c2962f99afa60d44da4ba865be4f211860f15b64d2a04400b19f477d68f46652949675fcb236ec3c7d7b760507
DIST pip-19.0.2.tar.gz 1324514 BLAKE2B dc9771706d3cfaea8a0ff562606b2a901836531e305ac5f0efdca983f715301ca3c9e19adb8d8a144006a3f703875a8ffb660a9a015b0749170f4b6564d0df8a SHA512 c6e13da3a57462371d32982c80575c5181592f5c6a8e70d60ec879e689442f4ad468e7aef97eb58c9da50a5a770385aa35e701eefd713a8e9fafeb12e11d956b
DIST pip-19.0.tar.gz 1321823 BLAKE2B 43e011102524a8558e8e44e50d4be04d21db4d87a512259fd09aa3982e84c6d932b608a914335cd5b340aaadfa88a28aedf6df311384e3d28c33f598dda9a548 SHA512 1de07b7e660745d0f25a047acc4566e19ab003e8668dbe669d96852c2cecbde0862bc9608eda483272314ace195f073fc3fa999979c508bd21641ea06b8ccd13
EBUILD pip-18.0.ebuild 1375 BLAKE2B f789a85e9e9ce3fe276a03ef97fe3830a18247a0579fdb67adbdf675bc4e241434be9edaa7fbc44b6663e567a9fa20fc14d59a7505dda37576429323b6e6971a SHA512 6143f11b2134613d66ed44bbbf799cdd84b90955594bca9551a9722c26be4f301c8039997b023f1283e58da7ff6b00b72368ff80b1e90fc60da432d726a63653
EBUILD pip-18.1.ebuild 1375 BLAKE2B f789a85e9e9ce3fe276a03ef97fe3830a18247a0579fdb67adbdf675bc4e241434be9edaa7fbc44b6663e567a9fa20fc14d59a7505dda37576429323b6e6971a SHA512 6143f11b2134613d66ed44bbbf799cdd84b90955594bca9551a9722c26be4f301c8039997b023f1283e58da7ff6b00b72368ff80b1e90fc60da432d726a63653
EBUILD pip-19.0.1.ebuild 1375 BLAKE2B f789a85e9e9ce3fe276a03ef97fe3830a18247a0579fdb67adbdf675bc4e241434be9edaa7fbc44b6663e567a9fa20fc14d59a7505dda37576429323b6e6971a SHA512 6143f11b2134613d66ed44bbbf799cdd84b90955594bca9551a9722c26be4f301c8039997b023f1283e58da7ff6b00b72368ff80b1e90fc60da432d726a63653
EBUILD pip-19.0.2.ebuild 1375 BLAKE2B f789a85e9e9ce3fe276a03ef97fe3830a18247a0579fdb67adbdf675bc4e241434be9edaa7fbc44b6663e567a9fa20fc14d59a7505dda37576429323b6e6971a SHA512 6143f11b2134613d66ed44bbbf799cdd84b90955594bca9551a9722c26be4f301c8039997b023f1283e58da7ff6b00b72368ff80b1e90fc60da432d726a63653
EBUILD pip-19.0.ebuild 1375 BLAKE2B f789a85e9e9ce3fe276a03ef97fe3830a18247a0579fdb67adbdf675bc4e241434be9edaa7fbc44b6663e567a9fa20fc14d59a7505dda37576429323b6e6971a SHA512 6143f11b2134613d66ed44bbbf799cdd84b90955594bca9551a9722c26be4f301c8039997b023f1283e58da7ff6b00b72368ff80b1e90fc60da432d726a63653
MISC metadata.xml 366 BLAKE2B 6cfb3fe9bd6fa72a5bc5aafb74d7f79eaa1fdf273cf45be4fb7989fd917ea8b1ad60a855770cc51944611e7590abeec450ed02c7c9ae8d850084c2b4f7c0d009 SHA512 43ccb12f2797cb70b59ff495d149c32c813e5145c65521eda9a86f675eac7756eefadeb9f4ca977e8e8c7019bae144b445240e6d7128da771eaf6d19559336f6

View File

@ -0,0 +1,18 @@
install: Raise an error to avoid breaking python-exec
Running pip without --target, --root, or --user will result in packages
being installed systemwide. This has a tendency to break python-exec if
setuptools gets installed or upgraded.
--- pip-10.0.1/src/pip/_internal/commands/install.py
+++ pip-10.0.1/src/pip/_internal/commands/install.py
@@ -202,6 +202,9 @@
if options.upgrade:
upgrade_strategy = options.upgrade_strategy
+ if not options.use_user_site and not options.target_dir and not options.root_path:
+ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
+
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)

View File

@ -0,0 +1,19 @@
Don't check for new versions of pip.
--- pip-10.0.1/src/pip/_internal/basecommand.py
+++ pip-10.0.1/src/pip/_internal/basecommand.py
@@ -255,14 +255,6 @@
return UNKNOWN_ERROR
finally:
- # Check if we're using the latest version of pip available
- if (not options.disable_pip_version_check and not
- getattr(options, "no_index", False)):
- with self._build_session(
- options,
- retries=0,
- timeout=min(5, options.timeout)) as session:
- pip_version_check(session, options)
# Avoid leaking loggers
for handler in set(logging.root.handlers) - original_root_handlers:
# this method benefit from the Logger class internal lock

View File

@ -0,0 +1,14 @@
Don't check PyPI for new versions of pip by default, updates will occur when
new releases are added to the tree.
--- pip-6.0.2/pip/cmdoptions.py
+++ pip-6.0.2/pip/cmdoptions.py
@@ -404,7 +404,7 @@
"--disable-pip-version-check",
dest="disable_pip_version_check",
action="store_true",
- default=False,
+ default=True,
help="Don't periodically check PyPI to determine whether a new version "
"of pip is available for download.")

View File

@ -0,0 +1,34 @@
pip/_vendor/__init__.py | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/pip/_vendor/__init__.py b/pip/_vendor/__init__.py
index ef8851d..349d022 100644
--- a/pip/_vendor/__init__.py
+++ b/pip/_vendor/__init__.py
@@ -14,7 +14,7 @@ import sys
# Downstream redistributors which have debundled our dependencies should also
# patch this value to be true. This will trigger the additional patching
# to cause things like "six" to be available as pip.
-DEBUNDLED = False
+DEBUNDLED = True
# By default, look in this directory for a bunch of .whl files which we will
# add to the beginning of sys.path before attempting to import anything. This
@@ -29,13 +29,10 @@ WHEEL_DIR = os.path.abspath(os.path.dirname(__file__))
def vendored(modulename):
vendored_name = "{0}.{1}".format(__name__, modulename)
- try:
- __import__(vendored_name, globals(), locals(), level=0)
- except ImportError:
- __import__(modulename, globals(), locals(), level=0)
- sys.modules[vendored_name] = sys.modules[modulename]
- base, head = vendored_name.rsplit(".", 1)
- setattr(sys.modules[base], head, sys.modules[modulename])
+ __import__(modulename, globals(), locals(), level=0)
+ sys.modules[vendored_name] = sys.modules[modulename]
+ base, head = vendored_name.rsplit(".", 1)
+ setattr(sys.modules[base], head, sys.modules[modulename])
# If we're operating in a debundled setup, then we want to go ahead and trigger

View File

@ -0,0 +1,43 @@
pip/_vendor/__init__.py | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/pip/_vendor/__init__.py b/pip/_vendor/__init__.py
index b09a7c3..b9fe6ee 100644
--- a/pip/_vendor/__init__.py
+++ b/pip/_vendor/__init__.py
@@ -14,7 +14,7 @@ import sys
# Downstream redistributors which have debundled our dependencies should also
# patch this value to be true. This will trigger the additional patching
# to cause things like "six" to be available as pip.
-DEBUNDLED = False
+DEBUNDLED = True
# By default, look in this directory for a bunch of .whl files which we will
# add to the beginning of sys.path before attempting to import anything. This
@@ -29,13 +29,10 @@ WHEEL_DIR = os.path.abspath(os.path.dirname(__file__))
def vendored(modulename):
vendored_name = "{0}.{1}".format(__name__, modulename)
- try:
- __import__(vendored_name, globals(), locals(), level=0)
- except ImportError:
- __import__(modulename, globals(), locals(), level=0)
- sys.modules[vendored_name] = sys.modules[modulename]
- base, head = vendored_name.rsplit(".", 1)
- setattr(sys.modules[base], head, sys.modules[modulename])
+ __import__(modulename, globals(), locals(), level=0)
+ sys.modules[vendored_name] = sys.modules[modulename]
+ base, head = vendored_name.rsplit(".", 1)
+ setattr(sys.modules[base], head, sys.modules[modulename])
# If we're operating in a debundled setup, then we want to go ahead and trigger
@@ -85,8 +82,6 @@ if DEBUNDLED:
vendored("requests.packages.urllib3.packages.ordered_dict")
vendored("requests.packages.urllib3.packages.six")
vendored("requests.packages.urllib3.packages.ssl_match_hostname")
- vendored("requests.packages.urllib3.packages.ssl_match_hostname."
- "_implementation")
vendored("requests.packages.urllib3.poolmanager")
vendored("requests.packages.urllib3.request")
vendored("requests.packages.urllib3.response")

View File

@ -0,0 +1,32 @@
From 890a1c26018752f2c57c7800968e4b8d1e0987f9 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Sun, 20 Nov 2016 19:52:40 +0100
Subject: [PATCH] Stop checking for new versions
---
pip/basecommand.py | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/pip/basecommand.py b/pip/basecommand.py
index 54c6706..3cffe86 100644
--- a/pip/basecommand.py
+++ b/pip/basecommand.py
@@ -241,15 +241,6 @@ class Command(object):
logger.critical('Exception:', exc_info=True)
return UNKNOWN_ERROR
- finally:
- # Check if we're using the latest version of pip available
- if (not options.disable_pip_version_check and not
- getattr(options, "no_index", False)):
- with self._build_session(
- options,
- retries=0,
- timeout=min(5, options.timeout)) as session:
- pip_version_check(session)
return SUCCESS
--
2.10.2

View File

@ -0,0 +1,29 @@
From 847553da616edabede18c69ba640a32b719b45a8 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Tue, 27 Oct 2015 12:20:44 -0400
Subject: [PATCH] install: Raise an error to avoid breaking python-exec
Running pip without --target, --root, or --user will result in packages
being installed systemwide. This has a tendency to break python-exec if
setuptools gets installed or upgraded.
---
pip/commands/install.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pip/commands/install.py b/pip/commands/install.py
index 46cd9f2..36b72f2 100644
--- a/pip/commands/install.py
+++ b/pip/commands/install.py
@@ -204,6 +204,9 @@ class InstallCommand(RequirementCommand):
)
options.ignore_installed = True
+ if not options.use_user_site and not options.target_dir and not options.root_path:
+ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
+
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)
--
2.6.2

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
<upstream>
<remote-id type="pypi">pip</remote-id>
<remote-id type="github">pypa/pip</remote-id>
</upstream>
</pkgmetadata>

View File

@ -0,0 +1,48 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy{,3} )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit eutils bash-completion-r1 distutils-r1
DESCRIPTION="Installs python packages -- replacement for easy_install"
HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
SLOT="0"
IUSE="-vanilla"
# required test data isn't bundled with the tarball
RESTRICT="test"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}/${PN}-10.0.1-disable-version-check.patch"
)
if ! use vanilla; then
PATCHES+=( "${FILESDIR}/pip-10.0.1-disable-system-install.patch" )
fi
distutils-r1_python_prepare_all
}
python_install_all() {
local DOCS=( AUTHORS.txt docs/*.rst )
distutils-r1_python_install_all
COMPLETION="${T}"/completion.tmp
"${PYTHON}" -m pip completion --bash > "${COMPLETION}" || die
newbashcomp "${COMPLETION}" ${PN}
"${PYTHON}" -m pip completion --zsh > "${COMPLETION}" || die
insinto /usr/share/zsh/site-functions
newins "${COMPLETION}" _pip
}

View File

@ -0,0 +1,48 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy{,3} )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit eutils bash-completion-r1 distutils-r1
DESCRIPTION="Installs python packages -- replacement for easy_install"
HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
SLOT="0"
IUSE="-vanilla"
# required test data isn't bundled with the tarball
RESTRICT="test"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}/${PN}-10.0.1-disable-version-check.patch"
)
if ! use vanilla; then
PATCHES+=( "${FILESDIR}/pip-10.0.1-disable-system-install.patch" )
fi
distutils-r1_python_prepare_all
}
python_install_all() {
local DOCS=( AUTHORS.txt docs/*.rst )
distutils-r1_python_install_all
COMPLETION="${T}"/completion.tmp
"${PYTHON}" -m pip completion --bash > "${COMPLETION}" || die
newbashcomp "${COMPLETION}" ${PN}
"${PYTHON}" -m pip completion --zsh > "${COMPLETION}" || die
insinto /usr/share/zsh/site-functions
newins "${COMPLETION}" _pip
}

View File

@ -0,0 +1,48 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy{,3} )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit eutils bash-completion-r1 distutils-r1
DESCRIPTION="Installs python packages -- replacement for easy_install"
HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
SLOT="0"
IUSE="-vanilla"
# required test data isn't bundled with the tarball
RESTRICT="test"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}/${PN}-10.0.1-disable-version-check.patch"
)
if ! use vanilla; then
PATCHES+=( "${FILESDIR}/pip-10.0.1-disable-system-install.patch" )
fi
distutils-r1_python_prepare_all
}
python_install_all() {
local DOCS=( AUTHORS.txt docs/*.rst )
distutils-r1_python_install_all
COMPLETION="${T}"/completion.tmp
"${PYTHON}" -m pip completion --bash > "${COMPLETION}" || die
newbashcomp "${COMPLETION}" ${PN}
"${PYTHON}" -m pip completion --zsh > "${COMPLETION}" || die
insinto /usr/share/zsh/site-functions
newins "${COMPLETION}" _pip
}

View File

@ -0,0 +1,48 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy{,3} )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit eutils bash-completion-r1 distutils-r1
DESCRIPTION="Installs python packages -- replacement for easy_install"
HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
SLOT="0"
IUSE="-vanilla"
# required test data isn't bundled with the tarball
RESTRICT="test"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}/${PN}-10.0.1-disable-version-check.patch"
)
if ! use vanilla; then
PATCHES+=( "${FILESDIR}/pip-10.0.1-disable-system-install.patch" )
fi
distutils-r1_python_prepare_all
}
python_install_all() {
local DOCS=( AUTHORS.txt docs/*.rst )
distutils-r1_python_install_all
COMPLETION="${T}"/completion.tmp
"${PYTHON}" -m pip completion --bash > "${COMPLETION}" || die
newbashcomp "${COMPLETION}" ${PN}
"${PYTHON}" -m pip completion --zsh > "${COMPLETION}" || die
insinto /usr/share/zsh/site-functions
newins "${COMPLETION}" _pip
}

View File

@ -0,0 +1,48 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} pypy{,3} )
PYTHON_REQ_USE="ssl(+),threads(+)"
inherit eutils bash-completion-r1 distutils-r1
DESCRIPTION="Installs python packages -- replacement for easy_install"
HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="MIT"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
SLOT="0"
IUSE="-vanilla"
# required test data isn't bundled with the tarball
RESTRICT="test"
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
RDEPEND="${DEPEND}"
python_prepare_all() {
local PATCHES=(
"${FILESDIR}/${PN}-10.0.1-disable-version-check.patch"
)
if ! use vanilla; then
PATCHES+=( "${FILESDIR}/pip-10.0.1-disable-system-install.patch" )
fi
distutils-r1_python_prepare_all
}
python_install_all() {
local DOCS=( AUTHORS.txt docs/*.rst )
distutils-r1_python_install_all
COMPLETION="${T}"/completion.tmp
"${PYTHON}" -m pip completion --bash > "${COMPLETION}" || die
newbashcomp "${COMPLETION}" ${PN}
"${PYTHON}" -m pip completion --zsh > "${COMPLETION}" || die
insinto /usr/share/zsh/site-functions
newins "${COMPLETION}" _pip
}