Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pip/files/, dev-python/pip/
Date: Sat, 01 Feb 2020 08:33:32
Message-Id: 1580545999.0ed9e986ca461fa075cfe52ce0fd8edc7f884f41.mgorny@gentoo
1 commit: 0ed9e986ca461fa075cfe52ce0fd8edc7f884f41
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 1 06:35:03 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 1 08:33:19 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ed9e986
7
8 dev-python/pip: Bump to 20.0.2
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pip/Manifest | 3 +
13 .../files/pip-20.0.2-disable-system-install.patch | 29 +++++
14 dev-python/pip/pip-20.0.2.ebuild | 137 +++++++++++++++++++++
15 3 files changed, 169 insertions(+)
16
17 diff --git a/dev-python/pip/Manifest b/dev-python/pip/Manifest
18 index 035862b6310..f0487112632 100644
19 --- a/dev-python/pip/Manifest
20 +++ b/dev-python/pip/Manifest
21 @@ -1,7 +1,10 @@
22 DIST pip-19.1.tar.gz 6320747 BLAKE2B 9b69fcdef751d6938a7c67f44692afa7088f660ab1e0ae113d21d0f48b4e29f43e0f0bcc137cf16ac0324ea3b500bd2a84234823f8d82556d6727f68139aab4b SHA512 0d2442c22c41133118353ba98f45260f0615a891725b2a069d8fbf26ec4033cc7297bb671944c3dcc1f68800b91e92e58fb407ca5a333382e20ac4bb5c9e0cb6
23 DIST pip-19.3.1.tar.gz 6409819 BLAKE2B b3aacd0bee60400a1f30b4be57871002072e5cc7a86e76cca1848e977ebdc85b6e282fc521c19bf7a518d1aef3280133fcd65a431cb2a16e202dd7721c5b97ad SHA512 39446c0ab6e4495d98f22923a2a76901b024d9047b60d92580b21d447a718e5285cfd66f8ad0c20befcfe1abc7f06be29b6a5644d1b30265d3b67399fe76e033
24 +DIST pip-20.0.2.tar.gz 6445047 BLAKE2B 8f6e0a8908cf594c8d51818942b0839f59a495697a95dcc0347235e90cbe6d7f035f155761e7da9cfca1ba08b2c5a2c5def52c60c381f5428ef48efd1b6b5131 SHA512 f9965944ca0f319d01db1638ce97cf64772afff1778b3b1271155de73208cfcb3954d89a469c1143c0bf3288a53d4446165a49df994374b16ac6f7ffdae85857
25 DIST pip-9.0.1.tar.gz 1197370 BLAKE2B 3618161690d5e0a38d141f9b51baea4aaa3fdc225664ef180bbeecf6e2df95e9ea4f97c63fe3a68f84f4fb5ebcc74e316827253c7e07b03565e58113bbaa918a SHA512 ee59efb4b009ff6543b7afdea99b9cbbee1981ecc03af586acda76674024d3b66dab23049e68f3da9448734984619fc1eaba6e965c9dd3d731973376c8a42e25
26 DIST setuptools-41.0.1-py2.py3-none-any.whl 575966 BLAKE2B 332986453a35e4ec36ab2bdb80a8b0a70ffe4fec1bb874f481b0d8e31016a26d53070f90d0eea9030b8c48a1f9bc21a54d8a5a2b70096e1f8db84d42449903e4 SHA512 c84ddf1d1ea90216b2c475f3e4879f4e6792a859adf61db70d67f49a35f2cb4df6fd6d93049881e6d2a8d914768edfcd091475206bb5da3ac66c41c4b9147102
27 DIST setuptools-41.4.0-py2.py3-none-any.whl 580302 BLAKE2B 58dc2d48445406f7467bfb0934dc507e8a569e4759bfcc95287cfb21b5b1a7bcab061656a29a8b4976ee3ae12a3adca570035ae4a6d9df09ae7a799857775d36 SHA512 a27b38d596931dfef81d705d05689b7748ce0e02d21af4a37204fc74b0913fa7241b8135535eb7749f09af361cad90c475af98493fef11c4ad974780ee01243d
28 +DIST setuptools-44.0.0-py2.py3-none-any.whl 583230 BLAKE2B 823e6792471660f247e30a938aa869d345a63db7294e5f9b4bd88f15a7694779011d29740fe317149620985f705fc6e18cbb07a18e5680cc11d7c229ffbc74f6 SHA512 7006fd303181afbeeec0e30cafb9fd1e4d3c6f55cfdd6343fedbc32b17dbb96b3d96ae37f4db27bfb168738727474cf425904ec280ff1d2b789fc48077a8fa84
29 DIST wheel-0.33.1-py2.py3-none-any.whl 21496 BLAKE2B 41bb9ed91d43f94209a010c286d541da9d68b9e727ec8a339fe3c24fb806746b1de5b62c6cd26d2c2841be17406e1f99353b6d172f5258540faeba014945e9e8 SHA512 761ad8cb96557b146642871e1f8ce75849a9828193d992a19d072236b9f8452ab54907a3b82bc7441f75f036155ae21b7450120e0c4c19aa5100b58337945ac0
30 DIST wheel-0.33.6-py2.py3-none-any.whl 21556 BLAKE2B 6b6124c1e8e70592399a90c88b2a70efc5885bad81d2ff07a2e243eee008ba5cb0c927454036915a61e97489e29fe1abc4ba2e63d7eadf1a8985c8a8b7cdf4c4 SHA512 4663cd55ee9d3de138216bb06870606b546b19cb6a733f1beab211c0ba72e63d849c422d320ddc8aa8275ad04a30119a84c1351e589150cd18c2a34f9fdb224a
31 +DIST wheel-0.34.2-py2.py3-none-any.whl 26502 BLAKE2B 3a1bd4571c582245b60ff33c9bf74ff8a2ebafb26e56fc7b9bd215058d059b6bd13bbe21ce46002af257813a54126f27e19253f211e21c4548c7cf84cd15caf7 SHA512 4f1a44f4691ed8baad777d7874f7f4da96a5019eb485fd3a9eed9259aa2a9d5acccc6dc63a72128664347c64ee039a6076c6ca9c3b75a1f94457967864e522ed
32
33 diff --git a/dev-python/pip/files/pip-20.0.2-disable-system-install.patch b/dev-python/pip/files/pip-20.0.2-disable-system-install.patch
34 new file mode 100644
35 index 00000000000..c6b5354bc68
36 --- /dev/null
37 +++ b/dev-python/pip/files/pip-20.0.2-disable-system-install.patch
38 @@ -0,0 +1,29 @@
39 +From 57d610bbcc721c2e58fd2e9f3197bb3e3acbd935 Mon Sep 17 00:00:00 2001
40 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
41 +Date: Sat, 1 Feb 2020 09:14:46 +0100
42 +Subject: [PATCH] install: Raise an error to avoid breaking python-exec
43 +
44 +Running pip without --target, --root, or --user will result in packages
45 +being installed systemwide. This has a tendency to break python-exec if
46 +setuptools gets installed or upgraded.
47 +---
48 + src/pip/_internal/commands/install.py | 3 +++
49 + 1 file changed, 3 insertions(+)
50 +
51 +diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py
52 +index 02a187c8..025b824b 100644
53 +--- a/src/pip/_internal/commands/install.py
54 ++++ b/src/pip/_internal/commands/install.py
55 +@@ -246,6 +246,9 @@ class InstallCommand(RequirementCommand):
56 + if options.upgrade:
57 + upgrade_strategy = options.upgrade_strategy
58 +
59 ++ if not options.use_user_site and not options.target_dir and not options.root_path and not os.getenv('GENTOO_PIP_TESTING'):
60 ++ raise CommandError("(Gentoo) Please run pip with the --user option to avoid breaking python-exec")
61 ++
62 + cmdoptions.check_dist_restriction(options, check_target=True)
63 +
64 + install_options = options.install_options or []
65 +--
66 +2.25.0
67 +
68
69 diff --git a/dev-python/pip/pip-20.0.2.ebuild b/dev-python/pip/pip-20.0.2.ebuild
70 new file mode 100644
71 index 00000000000..fe842dac954
72 --- /dev/null
73 +++ b/dev-python/pip/pip-20.0.2.ebuild
74 @@ -0,0 +1,137 @@
75 +# Copyright 1999-2020 Gentoo Authors
76 +# Distributed under the terms of the GNU General Public License v2
77 +
78 +EAPI=7
79 +
80 +DISTUTILS_USE_SETUPTOOLS=rdepend
81 +PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
82 +PYTHON_REQ_USE="ssl(+),threads(+)"
83 +
84 +inherit bash-completion-r1 distutils-r1 multiprocessing
85 +
86 +SETUPTOOLS_PV="44.0.0"
87 +WHEEL_PV="0.34.2"
88 +
89 +DESCRIPTION="Installs python packages -- replacement for easy_install"
90 +HOMEPAGE="https://pip.pypa.io/ https://pypi.org/project/pip/ https://github.com/pypa/pip/"
91 +SRC_URI="
92 + https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
93 + test? (
94 + https://files.pythonhosted.org/packages/py2.py3/s/setuptools/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl
95 + https://files.pythonhosted.org/packages/py2.py3/w/wheel/wheel-${WHEEL_PV}-py2.py3-none-any.whl
96 + )
97 +"
98 +# PyPI archive does not have tests, so we need to download from GitHub.
99 +# setuptools & wheel .whl files are required for testing, exact version is not very important.
100 +
101 +LICENSE="MIT"
102 +KEYWORDS="~amd64 ~arm64 ~sparc ~x86"
103 +SLOT="0"
104 +IUSE="test -vanilla"
105 +
106 +# disable-system-install patch breaks tests
107 +RESTRICT="!test? ( test )"
108 +
109 +RDEPEND="
110 + >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}]
111 +"
112 +DEPEND="
113 + ${RDEPEND}
114 + test? (
115 + dev-python/cryptography[${PYTHON_USEDEP}]
116 + dev-python/freezegun[${PYTHON_USEDEP}]
117 + dev-python/mock[${PYTHON_USEDEP}]
118 + dev-python/pretend[${PYTHON_USEDEP}]
119 + dev-python/pytest[${PYTHON_USEDEP}]
120 + dev-python/pyyaml[${PYTHON_USEDEP}]
121 + dev-python/scripttest[${PYTHON_USEDEP}]
122 + dev-python/virtualenv[${PYTHON_USEDEP}]
123 + dev-python/werkzeug[${PYTHON_USEDEP}]
124 + dev-python/wheel[${PYTHON_USEDEP}]
125 + )
126 +"
127 +
128 +python_prepare_all() {
129 + local PATCHES=(
130 + "${FILESDIR}/${PN}-19.3-disable-version-check.patch"
131 + )
132 + if ! use vanilla; then
133 + PATCHES+=( "${FILESDIR}/pip-20.0.2-disable-system-install.patch" )
134 + fi
135 + distutils-r1_python_prepare_all
136 +
137 + if use test; then
138 + mkdir tests/data/common_wheels/ || die
139 + cp "${DISTDIR}"/setuptools-${SETUPTOOLS_PV}-py2.py3-none-any.whl \
140 + tests/data/common_wheels/ || die
141 +
142 + cp "${DISTDIR}"/wheel-${WHEEL_PV}-py2.py3-none-any.whl \
143 + tests/data/common_wheels/ || die
144 + fi
145 +}
146 +
147 +python_test() {
148 + if [[ ${EPYTHON} == pypy* ]]; then
149 + ewarn "Skipping tests on ${EPYTHON} since they are very broken"
150 + return 0
151 + fi
152 +
153 + local -a exclude_tests
154 +
155 + # these will be built in to an expression passed to pytest to exclude
156 + exclude_tests=(
157 + git
158 + svn
159 + bazaar
160 + mercurial
161 + version_check
162 + uninstall_non_local_distutils
163 + pep518_uses_build_env
164 + install_package_with_root
165 + install_editable_with_prefix
166 + install_user_wheel
167 + install_from_current_directory_into_usersite
168 + uninstall_editable_from_usersite
169 + uninstall_from_usersite_with_dist_in_global_site
170 + build_env_isolation
171 + )
172 +
173 + distutils_install_for_testing
174 +
175 + # generate the expression to exclude failing tests
176 + local exclude_expr
177 + printf -v exclude_expr "or %s " "${exclude_tests[@]}" || die
178 + exclude_expr="not (${exclude_expr#or })" || die
179 +
180 + local -x GENTOO_PIP_TESTING=1 \
181 + PATH="${TEST_DIR}/scripts:${PATH}" \
182 + PYTHONPATH="${TEST_DIR}/lib:${BUILD_DIR}/lib"
183 +
184 + pytest -vv \
185 + -k "${exclude_expr}" \
186 + -m "not network" \
187 + || die "Tests fail with ${EPYTHON}"
188 +}
189 +
190 +python_install_all() {
191 + # Prevent dbus auto-launch
192 + # https://bugs.gentoo.org/692178
193 + export DBUS_SESSION_BUS_ADDRESS="disabled:"
194 +
195 + local DOCS=( AUTHORS.txt docs/html/**/*.rst )
196 + distutils-r1_python_install_all
197 +
198 + COMPLETION="${T}"/completion.tmp
199 +
200 + # 'pip completion' command embeds full $0 into completion script, which confuses
201 + # 'complete' and causes QA warning when running as "${PYTHON} -m pip".
202 + # This trick sets correct $0 while still calling just installed pip.
203 + local pipcmd='import sys; sys.argv[0] = "pip"; import pip.__main__; sys.exit(pip.__main__._main())'
204 +
205 + ${PYTHON} -c "${pipcmd}" completion --bash > "${COMPLETION}" || die
206 + newbashcomp "${COMPLETION}" ${PN}
207 +
208 + ${PYTHON} -c "${pipcmd}" completion --zsh > "${COMPLETION}" || die
209 + insinto /usr/share/zsh/site-functions
210 + newins "${COMPLETION}" _pip
211 +}