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/, dev-python/pip/files/
Date: Sun, 25 Apr 2021 10:36:44
Message-Id: 1619346997.25ced6fcac89fb582d8e6a193f4d118b833417f0.mgorny@gentoo
1 commit: 25ced6fcac89fb582d8e6a193f4d118b833417f0
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 25 07:15:53 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 25 10:36:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25ced6fc
7
8 dev-python/pip: Bump to 21.1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pip/Manifest | 2 +
13 dev-python/pip/files/pip-21.1-no-coverage.patch | 51 ++++++++++
14 dev-python/pip/pip-21.1.ebuild | 120 ++++++++++++++++++++++++
15 3 files changed, 173 insertions(+)
16
17 diff --git a/dev-python/pip/Manifest b/dev-python/pip/Manifest
18 index b77435b773a..8cba56a7e4a 100644
19 --- a/dev-python/pip/Manifest
20 +++ b/dev-python/pip/Manifest
21 @@ -1,3 +1,5 @@
22 DIST pip-21.0.1.tar.gz 8772082 BLAKE2B 2fdd78e2db8ceda2bd21fdeb4d29c0c2eda412827b87cc97ec1996a5b71b9c6e5938c0a6ef696163780bbbc55d81b8b3b1b6e2e79b05fbe9ce4bdd52e3ebdf13 SHA512 2db5397f4ca3a3f56f5add3f827bf1f0a4296019703438d68498266b9d2559b6baa3132061c5ad4c2a08bec6e76a2768763fdca02d86cf32aadd4640afbf3664
23 +DIST pip-21.1.tar.gz 8771224 BLAKE2B 2056a741b7f51d56c3984e2b0bcd1fa9cc12ba9677f80505fa5182fc0afad9c7dfe4ecf9429cf5ed5f8534f0a6a003b12455e90537a5dacbe188c8db548b71c3 SHA512 2617ae852cd52db980ab4131d711946b63930d30f480e050555bc61acb78577aa447b88065c6c8eba7e29c7167f78f04b11404cb0c1975caac464fa768ee7de8
24 DIST setuptools-51.3.3-py3-none-any.whl 786243 BLAKE2B cc8a98cdfd5cb78a342a3d50049c0ebd0965451e9bd4050b7a133346f505a17842a498531ade9bf932064a6cac81277ecf60d94ef94faa39b78740de87f9fd86 SHA512 1d4f29e392371b7f0e427d0570fddbdd1204f6c98e48a0a289db23b20f7c048551584ac946e30b90d720cce4f508b3c39208e9a70f87067d66734432963d141c
25 +DIST setuptools-56.0.0-py3-none-any.whl 784941 BLAKE2B 136352bcaeeb803f94983db2e0f9ec79dacc23a6742a2f6f1b4bdd2b29a104f4965d78f9b4adf1a501c7bf39d4ed85a6786b03489f90872661afbf5e674fd3f9 SHA512 32405236e9c2936cde137bc4d4d07b548391336ce0511cd5677dcd1f85c7a142b0947e03cdceaeb37067874f5aa71daacaa1a6af95ae9fe3ad8af264f61e10f4
26 DIST wheel-0.36.2-py2.py3-none-any.whl 35046 BLAKE2B bc4e8dab7c74eea34d3b4a813b7eaf6295a99a396a861b6cdd76f743043e89140bad132bdd13e385e8945ce02e0798e1d3ac73fc1b23bde5b2a83e4bb4dd5cdc SHA512 6bb5119b4d3704fe1e3c1eaaa3124edab13f61b46f8a0a8e75974fac4e5b25d8b53606071a03a8d8990ad1cfe2ab247ddea260098df2c0c35ae965be47080284
27
28 diff --git a/dev-python/pip/files/pip-21.1-no-coverage.patch b/dev-python/pip/files/pip-21.1-no-coverage.patch
29 new file mode 100644
30 index 00000000000..5f9c836d32e
31 --- /dev/null
32 +++ b/dev-python/pip/files/pip-21.1-no-coverage.patch
33 @@ -0,0 +1,51 @@
34 +From 66ca1e64ce3fb971ec30d5f8b2a0bda49721bc2d Mon Sep 17 00:00:00 2001
35 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
36 +Date: Wed, 29 Jul 2020 07:42:25 +0200
37 +Subject: [PATCH] Disable coverage testing support inside test venvs
38 +
39 +---
40 + tests/conftest.py | 14 +-------------
41 + 1 file changed, 1 insertion(+), 13 deletions(-)
42 +
43 +diff --git a/tests/conftest.py b/tests/conftest.py
44 +index a53e0c4f7..c91d1e1ae 100644
45 +--- a/tests/conftest.py
46 ++++ b/tests/conftest.py
47 +@@ -315,11 +315,6 @@ def wheel_install(tmpdir_factory, common_wheels):
48 + return _common_wheel_editable_install(tmpdir_factory, common_wheels, "wheel")
49 +
50 +
51 +-@××××××.fixture(scope="session")
52 +-def coverage_install(tmpdir_factory, common_wheels):
53 +- return _common_wheel_editable_install(tmpdir_factory, common_wheels, "coverage")
54 +-
55 +-
56 + def install_egg_link(venv, project_name, egg_info_dir):
57 + with open(venv.site / "easy-install.pth", "a") as fp:
58 + fp.write(str(egg_info_dir.resolve()) + "\n")
59 +@@ -329,7 +324,7 @@ def install_egg_link(venv, project_name, egg_info_dir):
60 +
61 + @pytest.fixture(scope="session")
62 + def virtualenv_template(
63 +- request, tmpdir_factory, pip_src, setuptools_install, coverage_install
64 ++ request, tmpdir_factory, pip_src, setuptools_install
65 + ):
66 +
67 + if request.config.getoption("--use-venv"):
68 +@@ -355,13 +350,6 @@ def virtualenv_template(
69 + [venv.bin / "python", "setup.py", "-q", "develop"], cwd=pip_editable
70 + )
71 +
72 +- # Install coverage and pth file for executing it in any spawned processes
73 +- # in this virtual environment.
74 +- install_egg_link(venv, "coverage", coverage_install)
75 +- # zz prefix ensures the file is after easy-install.pth.
76 +- with open(venv.site / "zz-coverage-helper.pth", "a") as f:
77 +- f.write("import coverage; coverage.process_startup()")
78 +-
79 + # Drop (non-relocatable) launchers.
80 + for exe in os.listdir(venv.bin):
81 + if not (
82 +--
83 +2.31.1
84 +
85
86 diff --git a/dev-python/pip/pip-21.1.ebuild b/dev-python/pip/pip-21.1.ebuild
87 new file mode 100644
88 index 00000000000..f6ec7e81791
89 --- /dev/null
90 +++ b/dev-python/pip/pip-21.1.ebuild
91 @@ -0,0 +1,120 @@
92 +# Copyright 1999-2021 Gentoo Authors
93 +# Distributed under the terms of the GNU General Public License v2
94 +
95 +EAPI=7
96 +
97 +DISTUTILS_USE_SETUPTOOLS=rdepend
98 +PYTHON_COMPAT=( python3_{7..9} pypy3 )
99 +PYTHON_REQ_USE="ssl(+),threads(+)"
100 +
101 +inherit bash-completion-r1 distutils-r1
102 +
103 +# setuptools & wheel .whl files are required for testing,
104 +# the exact version is not very important.
105 +SETUPTOOLS_WHL="setuptools-56.0.0-py3-none-any.whl"
106 +WHEEL_WHL="wheel-0.36.2-py2.py3-none-any.whl"
107 +
108 +DESCRIPTION="Installs python packages -- replacement for easy_install"
109 +HOMEPAGE="
110 + https://pip.pypa.io/en/stable/
111 + https://pypi.org/project/pip/
112 + https://github.com/pypa/pip/"
113 +SRC_URI="
114 + https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
115 + test? (
116 + https://files.pythonhosted.org/packages/py3/s/setuptools/${SETUPTOOLS_WHL}
117 + https://files.pythonhosted.org/packages/py2.py3/w/wheel/${WHEEL_WHL}
118 + )
119 +"
120 +
121 +LICENSE="MIT"
122 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
123 +SLOT="0"
124 +IUSE="test -vanilla"
125 +RESTRICT="!test? ( test )"
126 +
127 +RDEPEND="
128 + >=dev-python/setuptools-39.2.0[${PYTHON_USEDEP}]
129 +"
130 +BDEPEND="
131 + ${RDEPEND}
132 + test? (
133 + dev-python/cryptography[${PYTHON_USEDEP}]
134 + dev-python/csv23[${PYTHON_USEDEP}]
135 + dev-python/freezegun[${PYTHON_USEDEP}]
136 + dev-python/mock[${PYTHON_USEDEP}]
137 + dev-python/pretend[${PYTHON_USEDEP}]
138 + dev-python/pytest[${PYTHON_USEDEP}]
139 + dev-python/pyyaml[${PYTHON_USEDEP}]
140 + dev-python/scripttest[${PYTHON_USEDEP}]
141 + <dev-python/virtualenv-20[${PYTHON_USEDEP}]
142 + dev-python/werkzeug[${PYTHON_USEDEP}]
143 + dev-python/wheel[${PYTHON_USEDEP}]
144 + )
145 +"
146 +
147 +python_prepare_all() {
148 + local PATCHES=(
149 + "${FILESDIR}/${PN}-21.1-no-coverage.patch"
150 + )
151 + if ! use vanilla; then
152 + PATCHES+=( "${FILESDIR}/pip-20.0.2-disable-system-install.patch" )
153 + fi
154 +
155 + distutils-r1_python_prepare_all
156 +
157 + if use test; then
158 + mkdir tests/data/common_wheels/ || die
159 + cp "${DISTDIR}"/{${SETUPTOOLS_WHL},${WHEEL_WHL}} \
160 + tests/data/common_wheels/ || die
161 + fi
162 +}
163 +
164 +python_test() {
165 + if [[ ${EPYTHON} == pypy* ]]; then
166 + ewarn "Skipping tests on ${EPYTHON} since they are very broken"
167 + return 0
168 + fi
169 +
170 + local deselect=(
171 + tests/functional/test_install.py::test_double_install_fail
172 + tests/functional/test_list.py::test_multiple_exclude_and_normalization
173 + 'tests/unit/test_commands.py::test_index_group_handle_pip_version_check[False-False-True-download]'
174 + 'tests/unit/test_commands.py::test_index_group_handle_pip_version_check[False-False-True-install]'
175 + 'tests/unit/test_commands.py::test_index_group_handle_pip_version_check[False-False-True-list]'
176 + 'tests/unit/test_commands.py::test_index_group_handle_pip_version_check[False-False-True-wheel]'
177 + tests/functional/test_install.py::test_install_pip_does_not_modify_pip_when_satisfied
178 + # Internet
179 + tests/functional/test_install.py::test_install_editable_with_prefix_setup_cfg
180 + )
181 +
182 + distutils_install_for_testing --via-root
183 +
184 + local -x GENTOO_PIP_TESTING=1 \
185 + PATH="${TEST_DIR}/scripts:${PATH}" \
186 + PYTHONPATH="${TEST_DIR}/lib:${BUILD_DIR}/lib"
187 + epytest ${deselect[@]/#/--deselect } -m "not network"
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"; from pip._internal.cli.main import main; sys.exit(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 +}