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: Thu, 31 Mar 2022 16:47:24
Message-Id: 1648745233.5115f6b373c7956cbd7659fb9c852bad7902dbb1.chutzpah@gentoo
1 commit: 5115f6b373c7956cbd7659fb9c852bad7902dbb1
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 31 16:47:05 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 31 16:47:13 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5115f6b3
7
8 app-admin/salt: add 3002.8
9
10 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
11
12 app-admin/salt/Manifest | 1 +
13 .../salt/files/salt-3002.8-relax-pyzmq-dep.patch | 11 ++
14 app-admin/salt/files/salt-3002.8-tests.patch | 33 ++++
15 app-admin/salt/salt-3002.8.ebuild | 200 +++++++++++++++++++++
16 4 files changed, 245 insertions(+)
17
18 diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
19 index cba2b2758bbf..c5be9145b95b 100644
20 --- a/app-admin/salt/Manifest
21 +++ b/app-admin/salt/Manifest
22 @@ -3,6 +3,7 @@ DIST salt-3000.8.tar.gz 15249139 BLAKE2B df306669ba11dd650621222ff9c69f5a6e16b6f
23 DIST salt-3000.9.tar.gz 15250432 BLAKE2B b76c166363b0b0fd3e3aa4b5306ba8280a2c99fbc7fd9866d957406bba8e6fcc03b769b53dbb80b115f9fa9f1fdc93e1eb257f4bf04283e414a309c16e4f078f SHA512 94214f20a8a080ebdcbb7e3351f60a466c3a92cc85d177c2ea677192a63e58b0f9cacfb1af04e14022a7ac570ebd0b931722d1d001a7655dcd7502813c29a092
24 DIST salt-3001.8.tar.gz 15740488 BLAKE2B 77875a670b81438280becd1f29b64fbc766379192a9ca041568cd9360a3c4213bb3018063e88a297e9d1f637fb7ca3ef049a73a258022ec07e42f01a40bdf09a SHA512 8e90b2a1f82f951ab40a53a8af2ab421758ed8244f1881cc7aa71a8d9c2e2e6d892166ec8f8f6182966e56eb28c9aee6a060ee54b559b1d073fba97ad0afb013
25 DIST salt-3002.7.tar.gz 15792124 BLAKE2B b4cb4a6d73c45f3c2183a7adfe8196bbc5788dce1995bd5c640cd9957bdfdba2e96deebaba927d6103fc50f4eaab86d51f4dd4594d25b7357db79ed67b39258e SHA512 c1e7bbcd39b5c2bef351bd74026346bf729839c4161f6eff8162620e9cb08a63073abeeb8af6bab635070386a883df494ef08cc07a84efa9aa7f2160b357a938
26 +DIST salt-3002.8.tar.gz 15798643 BLAKE2B 12280dfd29f46f9bb8b2df6fcef474c2c2237d6f9c71e1474caae58893605dd6f9fb4c4573f52765cb950cd15e31fc0fda2fa8dd1c87d48c1951d2812c1a3a81 SHA512 a88a6f77d2af2cff5d5244f38b16a1904da05bdfd45b2087691e41b07f21785b1838151314d7c80d3a33eebefe480c8f3678fa161e9ceaaa50c997022463c472
27 DIST salt-3003.3.tar.gz 16017984 BLAKE2B 9cd1e33a7b6dff4d3c6c5a87e1204f7f113b6190da8301061e26fcec178aba597a9e17ab60a54a67b52a895a9a8aef58bec70e9fdd8d8edc5a42945f6de21a58 SHA512 4fe50922833fce48fcc679adb16a0e1fe893531b2feb08b235a1461c58b8d9a72af2acd89fc0f712207fb0cd215d6b446e31a40001b46c43d0cc4ac827ce29e3
28 DIST salt-3003.4.tar.gz 16031515 BLAKE2B 34902aba7ab64f4ddbacbad1b776b9b2218caf22fb843879a80bd5c30b6c28f4c22a050bbaf0e9735507a78c887f52bcae7d1833ffeb51a543ec22fda79252e6 SHA512 35419fbb3f9a0f3e87579f740b717d6902cab0d85397b16d1e94d9516bf5f5d269b4f8bca370fd376abd9b7c8a6ad7ef4c8e8a8fdd31655fd17c810989e79693
29 DIST salt-3003.tar.gz 15830910 BLAKE2B ea4f02eece951c3fb4fcc480d00f7b531ac549b2e23ff9a210b73f749f9ba83e0402e02a59028f41f94958d17512e417b7c1b7015e8ee3aeac55be9b1374fe6f SHA512 7f631466372f303c03f2852a5cfba1ee5c6ba1636a6fe1e1622e90d0b1376ef9f670aa1b4754f3d9c8c7fe1b99fe1b4c49e140dc86d90d157a1ec1e73ba43c38
30
31 diff --git a/app-admin/salt/files/salt-3002.8-relax-pyzmq-dep.patch b/app-admin/salt/files/salt-3002.8-relax-pyzmq-dep.patch
32 new file mode 100644
33 index 000000000000..e42a22b4e8b7
34 --- /dev/null
35 +++ b/app-admin/salt/files/salt-3002.8-relax-pyzmq-dep.patch
36 @@ -0,0 +1,11 @@
37 +diff --git a/requirements/zeromq.txt b/requirements/zeromq.txt
38 +index 77c9bd8be1..ffa1589043 100644
39 +--- a/requirements/zeromq.txt
40 ++++ b/requirements/zeromq.txt
41 +@@ -1,5 +1,4 @@
42 + -r base.txt
43 + -r crypto.txt
44 +
45 +-pyzmq>=17.0.0 ; python_version < "3.9"
46 +-pyzmq>=19.0.2 ; python_version >= "3.9"
47 ++pyzmq
48
49 diff --git a/app-admin/salt/files/salt-3002.8-tests.patch b/app-admin/salt/files/salt-3002.8-tests.patch
50 new file mode 100644
51 index 000000000000..c94a0c106347
52 --- /dev/null
53 +++ b/app-admin/salt/files/salt-3002.8-tests.patch
54 @@ -0,0 +1,33 @@
55 +diff --git a/salt/transport/mixins/auth.py b/salt/transport/mixins/auth.py
56 +index de86773750..3ca09260a0 100644
57 +--- a/salt/transport/mixins/auth.py
58 ++++ b/salt/transport/mixins/auth.py
59 +@@ -54,7 +54,7 @@ class AESPubClientMixin:
60 + @salt.ext.tornado.gen.coroutine
61 + def _decode_payload(self, payload):
62 + # we need to decrypt it
63 +- log.trace("Decoding payload: %s", payload)
64 ++ log.debug("Decoding payload: %s", payload)
65 + if payload["enc"] == "aes":
66 + self._verify_master_signature(payload)
67 + try:
68 +diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py
69 +index 97bce1f10b..2ff5904b87 100644
70 +--- a/tests/unit/utils/test_schema.py
71 ++++ b/tests/unit/utils/test_schema.py
72 +@@ -835,6 +835,7 @@ class ConfigTestCase(TestCase):
73 + )
74 +
75 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
76 ++ @skipIf(True, "Broken with newer versions of jsonschema")
77 + def test_hostname_config_validation(self):
78 + class TestConf(schema.Schema):
79 + item = schema.HostnameItem(title="Item", description="Item description")
80 +@@ -2060,6 +2061,7 @@ class ConfigTestCase(TestCase):
81 + item = schema.NotItem(item=schema.BooleanItem())
82 + self.assertEqual(item.serialize(), {"not": item.item.serialize()})
83 +
84 ++ @skipIf(True, "Broken with newer versions of jsonschema")
85 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
86 + def test_not_config_validation(self):
87 + class TestConf(schema.Schema):
88
89 diff --git a/app-admin/salt/salt-3002.8.ebuild b/app-admin/salt/salt-3002.8.ebuild
90 new file mode 100644
91 index 000000000000..023fe6aa7470
92 --- /dev/null
93 +++ b/app-admin/salt/salt-3002.8.ebuild
94 @@ -0,0 +1,200 @@
95 +# Copyright 1999-2022 Gentoo Authors
96 +# Distributed under the terms of the GNU General Public License v2
97 +
98 +EAPI=8
99 +PYTHON_COMPAT=( python3_{7..9} )
100 +
101 +inherit systemd distutils-r1
102 +
103 +DESCRIPTION="Salt is a remote execution and configuration manager"
104 +HOMEPAGE="https://www.saltstack.com/resources/community/
105 + https://github.com/saltstack"
106 +
107 +if [[ ${PV} == 9999* ]]; then
108 + inherit git-r3
109 + EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git"
110 + EGIT_BRANCH="develop"
111 + SRC_URI=""
112 +else
113 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
114 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
115 +fi
116 +
117 +LICENSE="Apache-2.0"
118 +SLOT="0"
119 +IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
120 + mongodb neutron nova openssl portage profile redis selinux test raet
121 + +zeromq vim-syntax"
122 +
123 +RDEPEND="
124 + sys-apps/pciutils
125 + >=dev-python/distro-1.5[${PYTHON_USEDEP}]
126 + dev-python/jinja[${PYTHON_USEDEP}]
127 + dev-python/libnacl[${PYTHON_USEDEP}]
128 + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
129 + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
130 + dev-python/pyyaml[${PYTHON_USEDEP}]
131 + dev-python/markupsafe[${PYTHON_USEDEP}]
132 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
133 + dev-python/setuptools[${PYTHON_USEDEP}]
134 + dev-python/toml[${PYTHON_USEDEP}]
135 + dev-python/watchdog[${PYTHON_USEDEP}]
136 + libcloud? ( >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}] )
137 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
138 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
139 + libvirt? (
140 + $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8)
141 + )
142 + openssl? (
143 + dev-libs/openssl:0=[-bindist(-)]
144 + dev-python/pyopenssl[${PYTHON_USEDEP}]
145 + )
146 + raet? (
147 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
148 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
149 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
150 + )
151 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
152 + cheetah? ( dev-python/cheetah3[${PYTHON_USEDEP}] )
153 + genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
154 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
155 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
156 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
157 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
158 + selinux? ( sec-policy/selinux-salt )
159 + nova? (
160 + $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8)
161 + )
162 + neutron? (
163 + $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8)
164 + )
165 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
166 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
167 + vim-syntax? ( app-vim/salt-vim )
168 + zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] )
169 +"
170 +BDEPEND="
171 + test? (
172 + ${RDEPEND}
173 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
174 + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
175 + >=dev-python/libcloud-0.14.0[${PYTHON_USEDEP}]
176 + dev-python/mako[${PYTHON_USEDEP}]
177 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
178 + >=dev-python/moto-0.3.6[${PYTHON_USEDEP}]
179 + dev-python/pip[${PYTHON_USEDEP}]
180 + dev-python/psutil[${PYTHON_USEDEP}]
181 + dev-python/pytest[${PYTHON_USEDEP}]
182 + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
183 + >=dev-python/pytest-salt-factories-0.93.0[${PYTHON_USEDEP}]
184 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
185 + >=dev-python/virtualenv-20.0.20[${PYTHON_USEDEP}]
186 + net-dns/bind-tools
187 + !x86? ( >=dev-python/boto3-1.3.15[${PYTHON_USEDEP}] )
188 + )"
189 +
190 +DOCS=( README.rst AUTHORS )
191 +
192 +REQUIRED_USE="
193 + || ( raet zeromq )
194 + test? ( cheetah genshi )
195 +"
196 +RESTRICT="!test? ( test ) x86? ( test )"
197 +
198 +PATCHES=(
199 + "${FILESDIR}/salt-2019.2.0-skip-tests-that-oom-machine.patch"
200 + "${FILESDIR}/salt-3002-dont-realpath-on-tmpdir.patch"
201 + "${FILESDIR}/salt-3002-tests.patch"
202 + "${FILESDIR}/salt-3002.5-tests.patch"
203 + "${FILESDIR}/salt-3002.7-tests.patch"
204 + "${FILESDIR}/salt-3004.1-jinja-3.patch"
205 + "${FILESDIR}/salt-3002.8-tests.patch"
206 + "${FILESDIR}/salt-3002.8-relax-pyzmq-dep.patch"
207 +)
208 +
209 +python_prepare_all() {
210 + # remove tests with external dependencies that may not be available, and
211 + # tests that don't work in sandbox
212 + rm tests/unit/{test_{zypp_plugins,module_names},utils/test_{extend,cache}}.py || die
213 + rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die
214 + rm tests/unit/states/test_boto_vpc.py || die
215 + rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die
216 + rm salt/utils/virtualbox.py || die
217 +
218 + # tests that require network access
219 + rm tests/unit/{states,modules}/test_zcbuildout.py || die
220 +
221 + sed -i 's:log.trace(:log.debug(:' \
222 + salt/fileserver/roots.py salt/grains/core.py salt/states/saltmod.py || die
223 +
224 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
225 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
226 + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die
227 + # pycryptodome rather than pycryptodomex
228 + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die
229 +
230 + distutils-r1_python_prepare_all
231 +}
232 +
233 +python_prepare() {
234 + einfo "Fixing collections.abc warnings for ${EPYTHON}"
235 + local abc
236 + abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die
237 + find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die
238 +}
239 +
240 +python_install_all() {
241 + local svc
242 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
243 +
244 + for svc in minion master syndic api; do
245 + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
246 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
247 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
248 + done
249 +
250 + insinto /etc/${PN}
251 + doins -r conf/*
252 +}
253 +
254 +python_test() {
255 + local tempdir
256 + # testsuite likes lots of files
257 + ulimit -n 3072 || die
258 +
259 + # ${T} is too long a path for the tests to work
260 + tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)"
261 + mkdir "${T}/$(basename "${tempdir}")"
262 +
263 + (
264 + cleanup() { rm -f "${tempdir}" || die; }
265 +
266 + trap cleanup EXIT
267 +
268 + addwrite "${tempdir}"
269 + ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die
270 +
271 + USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \
272 + TMPDIR="${tempdir}" \
273 + ${EPYTHON} tests/runtests.py \
274 + --unit-tests --no-report --verbose \
275 + || die "testing failed with ${EPYTHON}"
276 + )
277 +}
278 +
279 +pkg_postinst() {
280 + if use python_targets_python3_8; then
281 + if use nova; then
282 + ewarn "Salt's nova functionality will not work with python3.8 since"
283 + ewarn "dev-python/python-novaclient does not support it yet"
284 + fi
285 + if use neutron; then
286 + ewarn "Salt's neutron functionality will not work with python3.8 since"
287 + ewarn "dev-python/python-neutronclient does not support it yet"
288 + fi
289 + if use libvirt; then
290 + ewarn "Salt's libvirt functionality will not work with python3.8 since"
291 + ewarn "dev-python/libvirt-python does not support it yet"
292 + fi
293 + fi
294 +}