Gentoo Archives: gentoo-commits

From: Maxim Koltsov <maksbotan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pip/, dev-python/pip/files/
Date: Sun, 28 Apr 2019 08:15:44
Message-Id: 1556438512.64dad89900c7b185a01a2b64f14a57188fa4ed74.maksbotan@gentoo
1 commit: 64dad89900c7b185a01a2b64f14a57188fa4ed74
2 Author: Maxim Koltsov <maksbotan <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 27 19:27:04 2019 +0000
4 Commit: Maxim Koltsov <maksbotan <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 28 08:01:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=64dad899
7
8 dev-python/pip: bump to 19.1
9
10 - Bump EAPI to 7
11 - Fix completion file installation
12
13 Closes: https://bugs.gentoo.org/671286
14 Package-Manager: Portage-2.3.63, Repoman-2.3.12
15 Signed-off-by: Maxim Koltsov <maksbotan <AT> gentoo.org>
16
17 dev-python/pip/Manifest | 1 +
18 .../files/pip-19.1-disable-system-install.patch | 17 +++++++
19 .../pip/files/pip-19.1-disable-version-check.patch | 19 ++++++++
20 dev-python/pip/pip-19.1.ebuild | 53 ++++++++++++++++++++++
21 4 files changed, 90 insertions(+)
22
23 diff --git a/dev-python/pip/Manifest b/dev-python/pip/Manifest
24 index ca3c8caf9d8..f816ec613bd 100644
25 --- a/dev-python/pip/Manifest
26 +++ b/dev-python/pip/Manifest
27 @@ -1,3 +1,4 @@
28 DIST pip-10.0.1.tar.gz 1246072 BLAKE2B e08607be43e1d7b9c7bbc12dff73bc3170953f48f8f7439a0b27b9d540f23eb3bca7873211a5f1448b5cedd6e8e12983af6fa4666bba3ac4700059d170036733 SHA512 983cce8375ff0304263209c69be16e5be7a58af340b8c3ffddd64fcea130b2f8f8a98305ab31e9c3eed9a0d039c73777c88bde3bf2ea1e184fa3e0a2faa97fd4
29 +DIST pip-19.1.tar.gz 1334822 BLAKE2B afc2163c65a5ae181ffcf06f5fd8f321cff7c480d7cfac913b2f883c36840e79232f2a139f05659fc5bb583b8a35bdda583d22db152c8b8290c9e8c66e89dfaf SHA512 b10f6a8e0cc71b4987657acb90e677217a485f3605cca3ac9fe946102a8b6e07346d69952469db264e9aa7753015695818f107e361beab8a9fd0fbd5410900df
30 DIST pip-7.1.2.tar.gz 1049170 BLAKE2B 1461abba4cb80a9a4e806675ca2d996dedeeb8fb38f05b618f98f400475405da018ea6e75663c21b7b7eb5091408d602a3127afeea9a4bd29f075e5eb8042ad0 SHA512 78082afe6b559bf87f91ae9b6d304cfbfce00206e09be42fdae9d449a55cd8d968df6873e834191d0b0e6baae29e72eb3eee42386ff7c5dc9c29b6c28b754449
31 DIST pip-9.0.1.tar.gz 1197370 BLAKE2B 3618161690d5e0a38d141f9b51baea4aaa3fdc225664ef180bbeecf6e2df95e9ea4f97c63fe3a68f84f4fb5ebcc74e316827253c7e07b03565e58113bbaa918a SHA512 ee59efb4b009ff6543b7afdea99b9cbbee1981ecc03af586acda76674024d3b66dab23049e68f3da9448734984619fc1eaba6e965c9dd3d731973376c8a42e25
32
33 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
34 new file mode 100644
35 index 00000000000..bc88ef715a2
36 --- /dev/null
37 +++ b/dev-python/pip/files/pip-19.1-disable-system-install.patch
38 @@ -0,0 +1,17 @@
39 +install: Raise an error to avoid breaking python-exec
40 +
41 +Running pip without --target, --root, or --user will result in packages
42 +being installed systemwide. This has a tendency to break python-exec if
43 +setuptools gets installed or upgraded.
44 +
45 +--- pip-19.1/src/pip/_internal/commands/install.py
46 ++++ pip-19.1/src/pip/_internal/commands/install.py
47 +@@ -246,6 +246,9 @@ class InstallCommand(RequirementCommand):
48 + if options.upgrade:
49 + upgrade_strategy = options.upgrade_strategy
50 +
51 ++ if not options.use_user_site and not options.target_dir and not options.root_path:
52 ++ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
53 ++
54 + if options.build_dir:
55 + options.build_dir = os.path.abspath(options.build_dir)
56
57 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
58 new file mode 100644
59 index 00000000000..a46a47f0fc6
60 --- /dev/null
61 +++ b/dev-python/pip/files/pip-19.1-disable-version-check.patch
62 @@ -0,0 +1,19 @@
63 +Don't check for new versions of pip.
64 +
65 +--- pip-19.1/src/pip/_internal/cli/base_command.py
66 ++++ pip-19.1/src/pip/_internal/cli/base_command.py
67 +@@ -213,12 +213,8 @@ class Command(object):
68 +
69 + return UNKNOWN_ERROR
70 + finally:
71 +- allow_version_check = (
72 +- # Does this command have the index_group options?
73 +- hasattr(options, "no_index") and
74 +- # Is this command allowed to perform this check?
75 +- not (options.disable_pip_version_check or options.no_index)
76 +- )
77 ++ # Disabled on Gentoo
78 ++ allow_version_check = False
79 + # Check if we're using the latest version of pip available
80 + if allow_version_check:
81 + session = self._build_session(
82
83 diff --git a/dev-python/pip/pip-19.1.ebuild b/dev-python/pip/pip-19.1.ebuild
84 new file mode 100644
85 index 00000000000..f549d358e60
86 --- /dev/null
87 +++ b/dev-python/pip/pip-19.1.ebuild
88 @@ -0,0 +1,53 @@
89 +# Copyright 1999-2019 Gentoo Authors
90 +# Distributed under the terms of the GNU General Public License v2
91 +
92 +EAPI=7
93 +
94 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy{,3} )
95 +PYTHON_REQ_USE="ssl(+),threads(+)"
96 +
97 +inherit eutils bash-completion-r1 distutils-r1
98 +
99 +DESCRIPTION="Installs python packages -- replacement for easy_install"
100 +HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
101 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
102 +
103 +LICENSE="MIT"
104 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
105 +SLOT="0"
106 +IUSE="-vanilla"
107 +
108 +# required test data isn't bundled with the tarball
109 +RESTRICT="test"
110 +
111 +DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
112 +RDEPEND="${DEPEND}"
113 +
114 +python_prepare_all() {
115 + local PATCHES=(
116 + "${FILESDIR}/${PN}-19.1-disable-version-check.patch"
117 + )
118 + if ! use vanilla; then
119 + PATCHES+=( "${FILESDIR}/pip-19.1-disable-system-install.patch" )
120 + fi
121 + distutils-r1_python_prepare_all
122 +}
123 +
124 +python_install_all() {
125 + local DOCS=( AUTHORS.txt docs/html/**/*.rst )
126 + distutils-r1_python_install_all
127 +
128 + COMPLETION="${T}"/completion.tmp
129 +
130 + # 'pip completion' command embeds full $0 into completion script, which confuses
131 + # 'complete' and causes QA warning when running as "${PYTHON} -m pip".
132 + # This trick sets correct $0 while still calling just installed pip.
133 + local pipcmd='import sys; sys.argv[0] = "pip"; import pip.__main__; sys.exit(pip.__main__._main())'
134 +
135 + ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die
136 + newbashcomp "${COMPLETION}" ${PN}
137 +
138 + ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die
139 + insinto /usr/share/zsh/site-functions
140 + newins "${COMPLETION}" _pip
141 +}