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/files/, app-admin/salt/
Date: Wed, 02 Nov 2022 23:40:23
Message-Id: 1667432409.d3850ddf61052187f59b26d2359a31903c88ec9a.chutzpah@gentoo
1 commit: d3850ddf61052187f59b26d2359a31903c88ec9a
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Wed Nov 2 19:07:01 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 2 23:40:09 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3850ddf
7
8 app-admin/salt: add 3005.1
9
10 Closes: https://bugs.gentoo.org/875389
11 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
12
13 app-admin/salt/Manifest | 2 +-
14 .../files/salt-3005.1-importlib-metadata-5.patch | 37 ++++
15 .../salt/files/salt-3005.1-no-entry-points.patch | 13 ++
16 app-admin/salt/files/salt-3005.1-tests.patch | 40 ++++
17 app-admin/salt/salt-3005.1.ebuild | 219 +++++++++++++++++++++
18 5 files changed, 310 insertions(+), 1 deletion(-)
19
20 diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
21 index 1b9f3acc66a0..1dedeb2a1f3e 100644
22 --- a/app-admin/salt/Manifest
23 +++ b/app-admin/salt/Manifest
24 @@ -1,5 +1,5 @@
25 DIST salt-3002.9.tar.gz 15817470 BLAKE2B 31fb6dbb61a9f0ab22ca761810a934792e9fa9c78628f925e63d3d54d00fa4ea0b4aa806ba3ea92f7397ba3291281bf8989d9a288fb3114c7911cdebfc9acd6a SHA512 f34fd05960a68cba51f34cf8b7c737bd84d00472cec80628f082d16e54cf70705e191ac4b6690bf406a8a11e26c8155e4bdbdec34ede5f0721fd9b5e637a0ed1
26 -DIST salt-3003.4.tar.gz 16031515 BLAKE2B 34902aba7ab64f4ddbacbad1b776b9b2218caf22fb843879a80bd5c30b6c28f4c22a050bbaf0e9735507a78c887f52bcae7d1833ffeb51a543ec22fda79252e6 SHA512 35419fbb3f9a0f3e87579f740b717d6902cab0d85397b16d1e94d9516bf5f5d269b4f8bca370fd376abd9b7c8a6ad7ef4c8e8a8fdd31655fd17c810989e79693
27 DIST salt-3003.5.tar.gz 16056545 BLAKE2B ede3f0c63175f093dca07bee1bfb659cc608336ae92f532fc45868bd7eca659498c42e5d44324492744b802ade088adac869277679989550e217c1a135d6566d SHA512 ebda2056b4d6d216a0689b919d00aa78f615c355d21703d1939dbb6b00e9ad9347be4ee5b861282521f2d337bf7bf2fdc85e6942016358088a094d854fb33be9
28 DIST salt-3004.2.tar.gz 17685127 BLAKE2B a42e31d8a006488b3a6f341f817cde21ff86248d2b548d9914c429c62d7570cdf46cf2b41311cbb08ced7f9518e68156c6df3eb78e55cacfd4d40a4e7a54f52b SHA512 b2fa434f1d25eabac51d65d75bb020943eb71aff113d683e6f436a0f205bd3c7682b1b7acd4d9a62bf37a47eb0561293d263f3174d5e266f0998a1652fcae2ef
29 +DIST salt-3005.1.tar.gz 17914349 BLAKE2B 697c2068bf119e4a19f92a86ce880fec9375c10ba549cdcdd2182cfeaacce31c7bc4c4c91e1a609906b4c5373bb5e3120e0db47ede5b45ee20942d7b2d201e64 SHA512 391f995f0129f3d7104a0eea4fd83b18aa6ecae0fd7a2c77c1154e24b0bcd52cef4b63db12597c85737bb33ddf605e0c23370cef3bf47f9ea85af5b77d74dc50
30 DIST salt-3005.tar.gz 17894520 BLAKE2B 67e755bdbe772991f620d09f61836f8ccfa2039722c3281ec4cfaa8ef76e34c57e4db861cc652545e37eb965ab765f6b6ba0250407d7d7448aa5d4685ad9492a SHA512 c2019a97a5a98b4810cdace826d5e0a6d2890a984da4b95109c1b9328a2fd11cafd2fb0ef9752adeea1d36f8b2a69b3a4a6a5a092b6a7f050c60ec52da314a18
31
32 diff --git a/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch b/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch
33 new file mode 100644
34 index 000000000000..e4b19d6bfd7f
35 --- /dev/null
36 +++ b/app-admin/salt/files/salt-3005.1-importlib-metadata-5.patch
37 @@ -0,0 +1,37 @@
38 +commit b676e6338a7c094cb3335d11f851ac0e12222017
39 +Author: MKLeb <calebb@××××××.com>
40 +Date: Wed Oct 5 15:49:37 2022 -0400
41 +
42 + Allow entrypoint compatibility for importlib-metadata>=5.0.0
43 +
44 +diff --git a/salt/utils/entrypoints.py b/salt/utils/entrypoints.py
45 +index 3effa0b494..ac65ae2df4 100644
46 +--- a/salt/utils/entrypoints.py
47 ++++ b/salt/utils/entrypoints.py
48 +@@ -38,13 +38,20 @@ def iter_entry_points(group, name=None):
49 + entry_points_listing = []
50 + entry_points = importlib_metadata.entry_points()
51 +
52 +- for entry_point_group, entry_points_list in entry_points.items():
53 +- if entry_point_group != group:
54 +- continue
55 +- for entry_point in entry_points_list:
56 +- if name is not None and entry_point.name != name:
57 ++ # pre importlib-metadata 5.0.0
58 ++ if hasattr(entry_points, "items"):
59 ++ for entry_point_group, entry_points_list in entry_points.items():
60 ++ if entry_point_group != group:
61 + continue
62 +- entry_points_listing.append(entry_point)
63 ++ for entry_point in entry_points_list:
64 ++ if name is not None and entry_point.name != name:
65 ++ continue
66 ++ entry_points_listing.append(entry_point)
67 ++ # starting with importlib-metadata 5.0.0
68 ++ for entry_point in entry_points.select(group=group):
69 ++ if name is not None and entry_point.name != name:
70 ++ continue
71 ++ entry_points_listing.append(entry_point)
72 +
73 + return entry_points_listing
74 +
75
76 diff --git a/app-admin/salt/files/salt-3005.1-no-entry-points.patch b/app-admin/salt/files/salt-3005.1-no-entry-points.patch
77 new file mode 100644
78 index 000000000000..5d1da8f751e4
79 --- /dev/null
80 +++ b/app-admin/salt/files/salt-3005.1-no-entry-points.patch
81 @@ -0,0 +1,13 @@
82 +diff --git a/setup.py b/setup.py
83 +index bd11ff95f7..3b83f7b6ff 100755
84 +--- a/setup.py
85 ++++ b/setup.py
86 +@@ -1173,7 +1173,7 @@ class SaltDistribution(distutils.dist.Distribution):
87 + return scripts
88 +
89 + @property
90 +- def _property_entry_points(self):
91 ++ def _property_entry_points_disabled(self):
92 + entrypoints = {
93 + "pyinstaller40": [
94 + "hook-dirs = salt.utils.pyinstaller:get_hook_dirs",
95
96 diff --git a/app-admin/salt/files/salt-3005.1-tests.patch b/app-admin/salt/files/salt-3005.1-tests.patch
97 new file mode 100644
98 index 000000000000..101574bdd303
99 --- /dev/null
100 +++ b/app-admin/salt/files/salt-3005.1-tests.patch
101 @@ -0,0 +1,40 @@
102 +diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py
103 +index 8c648f5288..5886813e28 100644
104 +--- a/tests/unit/utils/test_schema.py
105 ++++ b/tests/unit/utils/test_schema.py
106 +@@ -528,7 +528,7 @@ class ConfigTestCase(TestCase):
107 + jsonschema.validate(
108 + {"personal_access_token": "foo"}, Requirements.serialize()
109 + )
110 +- if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0"):
111 ++ if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0") and JSONSCHEMA_VERSION < _LooseVersion("4.17.0"):
112 + self.assertIn(
113 + "'ssh_key_file' is a required property", excinfo.exception.message
114 + )
115 +@@ -1851,7 +1851,7 @@ class ConfigTestCase(TestCase):
116 + jsonschema.validate(
117 + {"item": {"sides": "4", "color": "blue"}}, TestConf.serialize()
118 + )
119 +- if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0"):
120 ++ if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0") and JSONSCHEMA_VERSION < _LooseVersion("4.17.0"):
121 + self.assertIn("'4'", excinfo.exception.message)
122 + self.assertIn("is not of type", excinfo.exception.message)
123 + self.assertIn("'boolean'", excinfo.exception.message)
124 +@@ -1974,7 +1974,7 @@ class ConfigTestCase(TestCase):
125 +
126 + with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
127 + jsonschema.validate({"item": ["maybe"]}, TestConf.serialize())
128 +- if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0"):
129 ++ if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0") and JSONSCHEMA_VERSION < _LooseVersion("4.17.0"):
130 + self.assertIn("'maybe'", excinfo.exception.message)
131 + self.assertIn("is not one of", excinfo.exception.message)
132 + self.assertIn("'yes'", excinfo.exception.message)
133 +@@ -2036,7 +2036,7 @@ class ConfigTestCase(TestCase):
134 +
135 + with self.assertRaises(jsonschema.exceptions.ValidationError) as excinfo:
136 + jsonschema.validate({"item": ["maybe"]}, TestConf.serialize())
137 +- if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0"):
138 ++ if JSONSCHEMA_VERSION >= _LooseVersion("3.0.0") and JSONSCHEMA_VERSION < _LooseVersion("4.17.0"):
139 + self.assertIn("'maybe'", excinfo.exception.message)
140 + self.assertIn("is not one of", excinfo.exception.message)
141 + self.assertIn("'yes'", excinfo.exception.message)
142
143 diff --git a/app-admin/salt/salt-3005.1.ebuild b/app-admin/salt/salt-3005.1.ebuild
144 new file mode 100644
145 index 000000000000..f5eeccf44bb3
146 --- /dev/null
147 +++ b/app-admin/salt/salt-3005.1.ebuild
148 @@ -0,0 +1,219 @@
149 +# Copyright 1999-2022 Gentoo Authors
150 +# Distributed under the terms of the GNU General Public License v2
151 +
152 +EAPI=8
153 +PYTHON_COMPAT=( python3_{8..10} )
154 +
155 +DISTUTILS_USE_PEP517=setuptools
156 +inherit systemd distutils-r1
157 +
158 +DESCRIPTION="Salt is a remote execution and configuration manager"
159 +HOMEPAGE="https://www.saltstack.com/resources/community/
160 + https://github.com/saltstack"
161 +
162 +if [[ ${PV} == 9999* ]]; then
163 + inherit git-r3
164 + EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git"
165 + EGIT_BRANCH="develop"
166 + SRC_URI=""
167 +else
168 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
169 + KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
170 +fi
171 +
172 +LICENSE="Apache-2.0"
173 +SLOT="0"
174 +IUSE="
175 + cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
176 + mongodb neutron nova openssl portage profile redis selinux test raet
177 + +zeromq vim-syntax
178 +"
179 +
180 +RDEPEND="
181 + sys-apps/pciutils
182 + >=dev-python/distro-1.5[${PYTHON_USEDEP}]
183 + >=dev-python/jinja-3.0.3[${PYTHON_USEDEP}]
184 + dev-python/jmespath[${PYTHON_USEDEP}]
185 + dev-python/libnacl[${PYTHON_USEDEP}]
186 + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
187 + >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}]
188 + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
189 + dev-python/pyyaml[${PYTHON_USEDEP}]
190 + >=dev-python/markupsafe-2.0.1[${PYTHON_USEDEP}]
191 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
192 + dev-python/setuptools[${PYTHON_USEDEP}]
193 + dev-python/tomli[${PYTHON_USEDEP}]
194 + dev-python/watchdog[${PYTHON_USEDEP}]
195 + libcloud? (
196 + dev-python/aiohttp[${PYTHON_USEDEP}]
197 + dev-python/aiosignal[${PYTHON_USEDEP}]
198 + dev-python/async-timeout[${PYTHON_USEDEP}]
199 + >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}]
200 + )
201 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
202 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
203 + libvirt? (
204 + dev-python/libvirt-python[${PYTHON_USEDEP}]
205 + )
206 + openssl? (
207 + dev-libs/openssl:0=[-bindist(-)]
208 + dev-python/pyopenssl[${PYTHON_USEDEP}]
209 + )
210 + raet? (
211 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
212 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
213 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
214 + )
215 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
216 + cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] )
217 + genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
218 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
219 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
220 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
221 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
222 + selinux? ( sec-policy/selinux-salt )
223 + nova? (
224 + >=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]
225 + )
226 + neutron? (
227 + >=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]
228 + )
229 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
230 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
231 + vim-syntax? ( app-vim/salt-vim )
232 + zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] )
233 +"
234 +BDEPEND="
235 + test? (
236 + ${RDEPEND}
237 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
238 + dev-python/certifi[${PYTHON_USEDEP}]
239 + dev-python/cherrypy[${PYTHON_USEDEP}]
240 + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
241 + dev-python/mako[${PYTHON_USEDEP}]
242 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
243 + >=dev-python/moto-2.0.0[${PYTHON_USEDEP}]
244 + dev-python/passlib
245 + dev-python/pip[${PYTHON_USEDEP}]
246 + dev-python/pyopenssl[${PYTHON_USEDEP}]
247 + >=dev-python/pytest-7.0.1[${PYTHON_USEDEP}]
248 + >=dev-python/pytest-salt-factories-1.0.0_rc17[${PYTHON_USEDEP}]
249 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
250 + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
251 + dev-python/pytest-subtests[${PYTHON_USEDEP}]
252 + dev-python/pytest-shell-utilities[${PYTHON_USEDEP}]
253 + dev-python/pytest-skip-markers[${PYTHON_USEDEP}]
254 + dev-python/pytest-system-statistics[${PYTHON_USEDEP}]
255 + dev-python/flaky[${PYTHON_USEDEP}]
256 + dev-python/libcloud[${PYTHON_USEDEP}]
257 + net-dns/bind-tools
258 + >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}]
259 + dev-util/yamllint[${PYTHON_USEDEP}]
260 + !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] )
261 + )
262 +"
263 +
264 +DOCS=( README.rst AUTHORS )
265 +
266 +REQUIRED_USE="|| ( raet zeromq )
267 + test? ( cheetah genshi )"
268 +RESTRICT="!test? ( test ) x86? ( test )"
269 +
270 +PATCHES=(
271 + "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch"
272 + "${FILESDIR}/salt-3003-gentoolkit-revdep.patch"
273 + "${FILESDIR}/salt-3002-tests.patch"
274 + "${FILESDIR}/salt-3003.1-tests.patch"
275 + "${FILESDIR}/salt-3005-relax-pyzmq-dep.patch"
276 + "${FILESDIR}/salt-3005-tests.patch"
277 + "${FILESDIR}/salt-3005.1-no-entry-points.patch"
278 + "${FILESDIR}/salt-3005.1-importlib-metadata-5.patch"
279 + "${FILESDIR}/salt-3005.1-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 + # removes contextvars, see bug: https://bugs.gentoo.org/799431
308 + sed -i '/^contextvars/d' requirements/base.txt || die
309 +
310 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
311 + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die
312 + # pycryptodome rather than pycryptodomex
313 + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die
314 +
315 + distutils-r1_python_prepare_all
316 +}
317 +
318 +python_install_all() {
319 + local svc
320 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
321 +
322 + for svc in minion master syndic api; do
323 + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
324 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
325 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
326 + done
327 +
328 + insinto /etc/${PN}
329 + doins -r conf/*
330 +}
331 +
332 +python_test() {
333 + # testsuite likes lots of files
334 + ulimit -n 4096 || die
335 +
336 + local -a disable_tests=(
337 + # doesn't like the distutils warning
338 + batch_retcode
339 + multiple_modules_in_batch
340 + # hangs indefinitely
341 + master_type_disable
342 + # needs root
343 + runas_env_sudo_group
344 + # don't like sandbox
345 + split_multibyte_characters_{shiftjis,unicode}
346 + # doesn't like sandbox env
347 + log_sanitize
348 + )
349 + local textexpr
350 + testexpr=$(printf 'not %s and ' "${disable_tests[@]}")
351 +
352 + # ${T} is too long a path for the tests to work
353 + local TMPDIR
354 + TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)" || die
355 + (
356 + export TMPDIR
357 + cleanup() { rm -rf "${TMPDIR}" || die; }
358 +
359 + trap cleanup EXIT
360 +
361 + addwrite "${TMPDIR}"
362 +
363 + USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \
364 + "${EPYTHON}" -m pytest -vv -k "${testexpr%and }" \
365 + || die "testing failed with ${EPYTHON}"
366 + )
367 +}