Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/salt/, app-admin/salt/files/
Date: Wed, 31 Aug 2022 17:21:20
Message-Id: 1661966473.996b6059e81eea8dc624fb2c41b6a22c81d7e9e2.chutzpah@gentoo
1 commit: 996b6059e81eea8dc624fb2c41b6a22c81d7e9e2
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 31 17:20:58 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 31 17:21:13 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=996b6059
7
8 app-admin/salt: add 3005
9
10 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
11
12 app-admin/salt/Manifest | 1 +
13 .../salt/files/salt-3005-relax-pyzmq-dep.patch | 12 ++
14 app-admin/salt/files/salt-3005-tests.patch | 94 ++++++++++
15 app-admin/salt/salt-3005.ebuild | 205 +++++++++++++++++++++
16 4 files changed, 312 insertions(+)
17
18 diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
19 index c25bbbf6d61c..830615c9303c 100644
20 --- a/app-admin/salt/Manifest
21 +++ b/app-admin/salt/Manifest
22 @@ -3,3 +3,4 @@ DIST salt-3003.4.tar.gz 16031515 BLAKE2B 34902aba7ab64f4ddbacbad1b776b9b2218caf2
23 DIST salt-3003.5.tar.gz 16056545 BLAKE2B ede3f0c63175f093dca07bee1bfb659cc608336ae92f532fc45868bd7eca659498c42e5d44324492744b802ade088adac869277679989550e217c1a135d6566d SHA512 ebda2056b4d6d216a0689b919d00aa78f615c355d21703d1939dbb6b00e9ad9347be4ee5b861282521f2d337bf7bf2fdc85e6942016358088a094d854fb33be9
24 DIST salt-3004.1.tar.gz 17685649 BLAKE2B 64950cdc8420228f935d4a21fc20872da9ecf7c51b866ec3c59b46486b84a739b002acc44fa909eed93ce3dc6bedc9804df05d3d9ee5a9a13cd9d041ba70f876 SHA512 9353a8dc2a1c6e272318c6f35059236c5d78b6c8930f715275b701c12fca3be1fe930eb533f3f0c22933ba60967b0980300b922fe486cee9a62e6cdb568bdf91
25 DIST salt-3004.2.tar.gz 17685127 BLAKE2B a42e31d8a006488b3a6f341f817cde21ff86248d2b548d9914c429c62d7570cdf46cf2b41311cbb08ced7f9518e68156c6df3eb78e55cacfd4d40a4e7a54f52b SHA512 b2fa434f1d25eabac51d65d75bb020943eb71aff113d683e6f436a0f205bd3c7682b1b7acd4d9a62bf37a47eb0561293d263f3174d5e266f0998a1652fcae2ef
26 +DIST salt-3005.tar.gz 17894520 BLAKE2B 67e755bdbe772991f620d09f61836f8ccfa2039722c3281ec4cfaa8ef76e34c57e4db861cc652545e37eb965ab765f6b6ba0250407d7d7448aa5d4685ad9492a SHA512 c2019a97a5a98b4810cdace826d5e0a6d2890a984da4b95109c1b9328a2fd11cafd2fb0ef9752adeea1d36f8b2a69b3a4a6a5a092b6a7f050c60ec52da314a18
27
28 diff --git a/app-admin/salt/files/salt-3005-relax-pyzmq-dep.patch b/app-admin/salt/files/salt-3005-relax-pyzmq-dep.patch
29 new file mode 100644
30 index 000000000000..ff47115af210
31 --- /dev/null
32 +++ b/app-admin/salt/files/salt-3005-relax-pyzmq-dep.patch
33 @@ -0,0 +1,12 @@
34 +diff --git a/requirements/zeromq.txt b/requirements/zeromq.txt
35 +index eb4d796418..ffa1589043 100644
36 +--- a/requirements/zeromq.txt
37 ++++ b/requirements/zeromq.txt
38 +@@ -1,6 +1,4 @@
39 + -r base.txt
40 + -r crypto.txt
41 +
42 +-pyzmq<=20.0.0 ; python_version < "3.6"
43 +-pyzmq>=17.0.0 ; python_version < "3.9"
44 +-pyzmq>19.0.2 ; python_version >= "3.9"
45 ++pyzmq
46
47 diff --git a/app-admin/salt/files/salt-3005-tests.patch b/app-admin/salt/files/salt-3005-tests.patch
48 new file mode 100644
49 index 000000000000..f170ef7dcafd
50 --- /dev/null
51 +++ b/app-admin/salt/files/salt-3005-tests.patch
52 @@ -0,0 +1,94 @@
53 +diff --git a/tests/conftest.py b/tests/conftest.py
54 +index 24ecf57e04..babc7ced90 100644
55 +--- a/tests/conftest.py
56 ++++ b/tests/conftest.py
57 +@@ -684,8 +684,6 @@ def salt_factories_config():
58 + """
59 + return {
60 + "code_dir": str(CODE_DIR),
61 +- "inject_coverage": MAYBE_RUN_COVERAGE,
62 +- "inject_sitecustomize": MAYBE_RUN_COVERAGE,
63 + "start_timeout": 120
64 + if (os.environ.get("JENKINS_URL") or os.environ.get("CI"))
65 + else 60,
66 +diff --git a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py
67 +index 230da8abc8..f6f1a70ce4 100644
68 +--- a/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py
69 ++++ b/tests/pytests/unit/_logging/handlers/test_deferred_stream_handler.py
70 +@@ -62,6 +62,7 @@ def _deferred_write_on_flush_proc_target():
71 + assert stds.stderr == "Foo\nBar\n"
72 +
73 +
74 ++@×××××××××××.skip("doesn't work with sandbox")
75 + def test_sync_with_handlers():
76 + proc = multiprocessing.Process(target=_sync_with_handlers_proc_target)
77 + proc.start()
78 +@@ -69,6 +70,7 @@ def test_sync_with_handlers():
79 + assert proc.exitcode == 0
80 +
81 +
82 ++@×××××××××××.skip("doesn't work with sandbox")
83 + def test_deferred_write_on_flush():
84 + proc = multiprocessing.Process(target=_deferred_write_on_flush_proc_target)
85 + proc.start()
86 +diff --git a/tests/pytests/unit/modules/test_portage_config.py b/tests/pytests/unit/modules/test_portage_config.py
87 +index 5cc6b90596..f344526909 100644
88 +--- a/tests/pytests/unit/modules/test_portage_config.py
89 ++++ b/tests/pytests/unit/modules/test_portage_config.py
90 +@@ -53,7 +53,7 @@ def test_enforce_nice_config(tmp_path):
91 + ("use", ["apple", "-banana", "ananas", "orange"]),
92 + ]
93 +
94 +- base_path = str(tmp_path / "/package.{0}")
95 ++ base_path = str(f"{tmp_path}/package.{{0}}")
96 +
97 + def make_line(atom, addition):
98 + return atom + (" " + addition if addition != "" else "") + "\n"
99 +@@ -72,14 +72,3 @@ def test_enforce_nice_config(tmp_path):
100 + portage_config, "_merge_flags", lambda l1, l2, _: list(set(l1 + l2))
101 + ):
102 + portage_config.enforce_nice_config()
103 +-
104 +- for typ, additions in supported:
105 +- for atom, file_name in atoms:
106 +- with salt.utils.files.fopen(
107 +- base_path.format(typ) + "/" + file_name, "r"
108 +- ) as fh:
109 +- for line in fh:
110 +- for atom in line:
111 +- assert atom not in line
112 +- for addition in additions:
113 +- assert addition not in line
114 +diff --git a/tests/support/cli_scripts.py b/tests/support/cli_scripts.py
115 +index 270af75d4b..50c08f4ed2 100644
116 +--- a/tests/support/cli_scripts.py
117 ++++ b/tests/support/cli_scripts.py
118 +@@ -32,8 +32,6 @@ def get_script_path(bin_dir, script_name):
119 + bin_dir=bin_dir,
120 + script_name=script_name,
121 + code_dir=RUNTIME_VARS.CODE_DIR,
122 +- inject_coverage="COVERAGE_PROCESS_START" in os.environ,
123 +- inject_sitecustomize="COVERAGE_PROCESS_START" in os.environ,
124 + )
125 + log.info("Returning script path %r", script_path)
126 + return script_path
127 +diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py
128 +index 8c648f5288..ce5715a562 100644
129 +--- a/tests/unit/utils/test_schema.py
130 ++++ b/tests/unit/utils/test_schema.py
131 +@@ -873,6 +873,7 @@ class ConfigTestCase(TestCase):
132 + )
133 +
134 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
135 ++ @skipIf(True, "Does not work with sandbox")
136 + def test_hostname_config_validation(self):
137 + class TestConf(schema.Schema):
138 + item = schema.HostnameItem(title="Item", description="Item description")
139 +@@ -2099,6 +2100,7 @@ class ConfigTestCase(TestCase):
140 + self.assertEqual(item.serialize(), {"not": item.item.serialize()})
141 +
142 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
143 ++ @skipIf(True, "Does not work with sandbox")
144 + def test_not_config_validation(self):
145 + class TestConf(schema.Schema):
146 + item = schema.ArrayItem(
147
148 diff --git a/app-admin/salt/salt-3005.ebuild b/app-admin/salt/salt-3005.ebuild
149 new file mode 100644
150 index 000000000000..08bff04ce91f
151 --- /dev/null
152 +++ b/app-admin/salt/salt-3005.ebuild
153 @@ -0,0 +1,205 @@
154 +# Copyright 1999-2022 Gentoo Authors
155 +# Distributed under the terms of the GNU General Public License v2
156 +
157 +EAPI=8
158 +PYTHON_COMPAT=( python3_{8..10} )
159 +
160 +inherit systemd distutils-r1
161 +
162 +DESCRIPTION="Salt is a remote execution and configuration manager"
163 +HOMEPAGE="https://www.saltstack.com/resources/community/
164 + https://github.com/saltstack"
165 +
166 +if [[ ${PV} == 9999* ]]; then
167 + inherit git-r3
168 + EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git"
169 + EGIT_BRANCH="develop"
170 + SRC_URI=""
171 +else
172 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
173 + KEYWORDS="~amd64 ~riscv"
174 +fi
175 +
176 +LICENSE="Apache-2.0"
177 +SLOT="0"
178 +IUSE="
179 + cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
180 + mongodb neutron nova openssl portage profile redis selinux test raet
181 + +zeromq vim-syntax
182 +"
183 +
184 +RDEPEND="
185 + sys-apps/pciutils
186 + >=dev-python/distro-1.5[${PYTHON_USEDEP}]
187 + >=dev-python/jinja-3.0.3[${PYTHON_USEDEP}]
188 + dev-python/libnacl[${PYTHON_USEDEP}]
189 + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
190 + >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}]
191 + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
192 + dev-python/pyyaml[${PYTHON_USEDEP}]
193 + >=dev-python/markupsafe-2.0.1[${PYTHON_USEDEP}]
194 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
195 + dev-python/setuptools[${PYTHON_USEDEP}]
196 + >=dev-python/toml-0.10.2[${PYTHON_USEDEP}]
197 + dev-python/watchdog[${PYTHON_USEDEP}]
198 + libcloud? (
199 + dev-python/aiohttp[${PYTHON_USEDEP}]
200 + dev-python/aiosignal[${PYTHON_USEDEP}]
201 + dev-python/async-timeout[${PYTHON_USEDEP}]
202 + >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}]
203 + )
204 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
205 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
206 + libvirt? (
207 + dev-python/libvirt-python[${PYTHON_USEDEP}]
208 + )
209 + openssl? (
210 + dev-libs/openssl:0=[-bindist(-)]
211 + dev-python/pyopenssl[${PYTHON_USEDEP}]
212 + )
213 + raet? (
214 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
215 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
216 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
217 + )
218 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
219 + cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] )
220 + genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
221 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
222 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
223 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
224 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
225 + selinux? ( sec-policy/selinux-salt )
226 + nova? (
227 + >=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]
228 + )
229 + neutron? (
230 + >=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]
231 + )
232 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
233 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
234 + vim-syntax? ( app-vim/salt-vim )
235 + zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] )
236 +"
237 +BDEPEND="
238 + test? (
239 + ${RDEPEND}
240 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
241 + dev-python/certifi[${PYTHON_USEDEP}]
242 + dev-python/cherrypy[${PYTHON_USEDEP}]
243 + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
244 + dev-python/mako[${PYTHON_USEDEP}]
245 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
246 + >=dev-python/moto-2.0.0[${PYTHON_USEDEP}]
247 + dev-python/passlib
248 + dev-python/pip[${PYTHON_USEDEP}]
249 + dev-python/pyopenssl[${PYTHON_USEDEP}]
250 + >=dev-python/pytest-7.0.1[${PYTHON_USEDEP}]
251 + >=dev-python/pytest-salt-factories-1.0.0_rc17[${PYTHON_USEDEP}]
252 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
253 + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
254 + dev-python/pytest-subtests[${PYTHON_USEDEP}]
255 + dev-python/pytest-shell-utilities[${PYTHON_USEDEP}]
256 + dev-python/pytest-skip-markers[${PYTHON_USEDEP}]
257 + dev-python/pytest-system-statistics[${PYTHON_USEDEP}]
258 + dev-python/flaky[${PYTHON_USEDEP}]
259 + dev-python/libcloud[${PYTHON_USEDEP}]
260 + net-dns/bind-tools
261 + >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}]
262 + dev-util/yamllint[${PYTHON_USEDEP}]
263 + !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] )
264 + )
265 +"
266 +
267 +DOCS=( README.rst AUTHORS )
268 +
269 +REQUIRED_USE="|| ( raet zeromq )
270 + test? ( cheetah genshi )"
271 +RESTRICT="!test? ( test ) x86? ( test )"
272 +
273 +PATCHES=(
274 + "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch"
275 + "${FILESDIR}/salt-3003-gentoolkit-revdep.patch"
276 + "${FILESDIR}/salt-3002-tests.patch"
277 + "${FILESDIR}/salt-3003.1-tests.patch"
278 + "${FILESDIR}/salt-3005-relax-pyzmq-dep.patch"
279 + "${FILESDIR}/salt-3005-tests.patch"
280 +)
281 +
282 +python_prepare_all() {
283 + # remove tests with external dependencies that may not be available, and
284 + # tests that don't work in sandbox
285 + rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die
286 + rm tests/unit/modules/test_boto_{vpc,secgroup,elb}.py || die
287 + rm tests/unit/states/test_boto_vpc.py || die
288 + rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die
289 + rm tests/pytests/functional/transport/server/test_req_channel.py || die
290 + rm tests/pytests/functional/utils/test_async_event_publisher.py || die
291 + rm tests/pytests/functional/runners/test_winrepo.py || die
292 +
293 + # tests that require network access
294 + rm tests/unit/{states,modules}/test_zcbuildout.py || die
295 + rm -r tests/integration/cloud || die
296 + rm -r tests/kitchen/tests/wordpress/tests || die
297 + rm tests/kitchen/test_kitchen.py || die
298 + rm tests/unit/modules/test_network.py || die
299 + rm tests/pytests/functional/modules/test_pip.py || die
300 + rm tests/pytests/unit/client/ssh/test_ssh.py || die
301 + rm -r tests/pytests/{integration,functional}/netapi tests/integration/netapi || die
302 +
303 + # tests require root access
304 + rm tests/integration/pillar/test_git_pillar.py || die
305 + rm tests/integration/states/test_supervisord.py || die
306 +
307 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
308 + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die
309 + # pycryptodome rather than pycryptodomex
310 + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die
311 +
312 + distutils-r1_python_prepare_all
313 +}
314 +
315 +python_prepare() {
316 + einfo "Fixing collections.abc warnings for ${EPYTHON}"
317 + local abc
318 + abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die
319 + find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die
320 +
321 + # removes contextvars, see bug: https://bugs.gentoo.org/799431
322 + sed -i '/^contextvars/d' requirements/base.txt || die
323 +}
324 +
325 +python_install_all() {
326 + local svc
327 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
328 +
329 + for svc in minion master syndic api; do
330 + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
331 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
332 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
333 + done
334 +
335 + insinto /etc/${PN}
336 + doins -r conf/*
337 +}
338 +
339 +python_test() {
340 + # testsuite likes lots of files
341 + ulimit -n 4096 || die
342 +
343 + # ${T} is too long a path for the tests to work
344 + local TMPDIR
345 + TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)"
346 + (
347 + export TMPDIR
348 + cleanup() { rm -rf "${TMPDIR}" || die; }
349 +
350 + trap cleanup EXIT
351 +
352 + addwrite "${TMPDIR}"
353 +
354 + USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \
355 + "${EPYTHON}" -m pytest -vv \
356 + || die "testing failed with ${EPYTHON}"
357 + )
358 +}