From 64dad89900c7b185a01a2b64f14a57188fa4ed74 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 27 Apr 2019 22:27:04 +0300 Subject: dev-python/pip: bump to 19.1 - Bump EAPI to 7 - Fix completion file installation Closes: https://bugs.gentoo.org/671286 Package-Manager: Portage-2.3.63, Repoman-2.3.12 Signed-off-by: Maxim Koltsov --- dev-python/pip/Manifest | 1 + .../files/pip-19.1-disable-system-install.patch | 17 +++++++ .../pip/files/pip-19.1-disable-version-check.patch | 19 ++++++++ dev-python/pip/pip-19.1.ebuild | 53 ++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 dev-python/pip/files/pip-19.1-disable-system-install.patch create mode 100644 dev-python/pip/files/pip-19.1-disable-version-check.patch create mode 100644 dev-python/pip/pip-19.1.ebuild diff --git a/dev-python/pip/Manifest b/dev-python/pip/Manifest index ca3c8caf9d88..f816ec613bd7 100644 --- a/dev-python/pip/Manifest +++ b/dev-python/pip/Manifest @@ -1,3 +1,4 @@ DIST pip-10.0.1.tar.gz 1246072 BLAKE2B e08607be43e1d7b9c7bbc12dff73bc3170953f48f8f7439a0b27b9d540f23eb3bca7873211a5f1448b5cedd6e8e12983af6fa4666bba3ac4700059d170036733 SHA512 983cce8375ff0304263209c69be16e5be7a58af340b8c3ffddd64fcea130b2f8f8a98305ab31e9c3eed9a0d039c73777c88bde3bf2ea1e184fa3e0a2faa97fd4 +DIST pip-19.1.tar.gz 1334822 BLAKE2B afc2163c65a5ae181ffcf06f5fd8f321cff7c480d7cfac913b2f883c36840e79232f2a139f05659fc5bb583b8a35bdda583d22db152c8b8290c9e8c66e89dfaf SHA512 b10f6a8e0cc71b4987657acb90e677217a485f3605cca3ac9fe946102a8b6e07346d69952469db264e9aa7753015695818f107e361beab8a9fd0fbd5410900df DIST pip-7.1.2.tar.gz 1049170 BLAKE2B 1461abba4cb80a9a4e806675ca2d996dedeeb8fb38f05b618f98f400475405da018ea6e75663c21b7b7eb5091408d602a3127afeea9a4bd29f075e5eb8042ad0 SHA512 78082afe6b559bf87f91ae9b6d304cfbfce00206e09be42fdae9d449a55cd8d968df6873e834191d0b0e6baae29e72eb3eee42386ff7c5dc9c29b6c28b754449 DIST pip-9.0.1.tar.gz 1197370 BLAKE2B 3618161690d5e0a38d141f9b51baea4aaa3fdc225664ef180bbeecf6e2df95e9ea4f97c63fe3a68f84f4fb5ebcc74e316827253c7e07b03565e58113bbaa918a SHA512 ee59efb4b009ff6543b7afdea99b9cbbee1981ecc03af586acda76674024d3b66dab23049e68f3da9448734984619fc1eaba6e965c9dd3d731973376c8a42e25 diff --git a/dev-python/pip/files/pip-19.1-disable-system-install.patch b/dev-python/pip/files/pip-19.1-disable-system-install.patch new file mode 100644 index 000000000000..bc88ef715a2e --- /dev/null +++ b/dev-python/pip/files/pip-19.1-disable-system-install.patch @@ -0,0 +1,17 @@ +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-19.1/src/pip/_internal/commands/install.py ++++ pip-19.1/src/pip/_internal/commands/install.py +@@ -246,6 +246,9 @@ class InstallCommand(RequirementCommand): + 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) diff --git a/dev-python/pip/files/pip-19.1-disable-version-check.patch b/dev-python/pip/files/pip-19.1-disable-version-check.patch new file mode 100644 index 000000000000..a46a47f0fc68 --- /dev/null +++ b/dev-python/pip/files/pip-19.1-disable-version-check.patch @@ -0,0 +1,19 @@ +Don't check for new versions of pip. + +--- pip-19.1/src/pip/_internal/cli/base_command.py ++++ pip-19.1/src/pip/_internal/cli/base_command.py +@@ -213,12 +213,8 @@ class Command(object): + + return UNKNOWN_ERROR + finally: +- allow_version_check = ( +- # Does this command have the index_group options? +- hasattr(options, "no_index") and +- # Is this command allowed to perform this check? +- not (options.disable_pip_version_check or options.no_index) +- ) ++ # Disabled on Gentoo ++ allow_version_check = False + # Check if we're using the latest version of pip available + if allow_version_check: + session = self._build_session( diff --git a/dev-python/pip/pip-19.1.ebuild b/dev-python/pip/pip-19.1.ebuild new file mode 100644 index 000000000000..f549d358e606 --- /dev/null +++ b/dev-python/pip/pip-19.1.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 python3_{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}-19.1-disable-version-check.patch" + ) + if ! use vanilla; then + PATCHES+=( "${FILESDIR}/pip-19.1-disable-system-install.patch" ) + fi + distutils-r1_python_prepare_all +} + +python_install_all() { + local DOCS=( AUTHORS.txt docs/html/**/*.rst ) + distutils-r1_python_install_all + + COMPLETION="${T}"/completion.tmp + + # 'pip completion' command embeds full $0 into completion script, which confuses + # 'complete' and causes QA warning when running as "${PYTHON} -m pip". + # This trick sets correct $0 while still calling just installed pip. + local pipcmd='import sys; sys.argv[0] = "pip"; import pip.__main__; sys.exit(pip.__main__._main())' + + ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die + newbashcomp "${COMPLETION}" ${PN} + + ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die + insinto /usr/share/zsh/site-functions + newins "${COMPLETION}" _pip +} -- cgit v1.2.3-65-gdbad