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 02:23:53
Message-Id: 1648692240.2e656abe1f5a5b83f8d23561892c22b485e8a621.chutzpah@gentoo
1 commit: 2e656abe1f5a5b83f8d23561892c22b485e8a621
2 Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 31 02:04:00 2022 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 31 02:04:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e656abe
7
8 app-admin/salt: add 3003.4
9
10 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
11
12 app-admin/salt/Manifest | 1 +
13 app-admin/salt/files/salt-3003.4-tests.patch | 52 +++++++
14 app-admin/salt/salt-3003.4.ebuild | 204 +++++++++++++++++++++++++++
15 3 files changed, 257 insertions(+)
16
17 diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest
18 index 3ee27efecc4d..cba2b2758bbf 100644
19 --- a/app-admin/salt/Manifest
20 +++ b/app-admin/salt/Manifest
21 @@ -4,5 +4,6 @@ DIST salt-3000.9.tar.gz 15250432 BLAKE2B b76c166363b0b0fd3e3aa4b5306ba8280a2c99f
22 DIST salt-3001.8.tar.gz 15740488 BLAKE2B 77875a670b81438280becd1f29b64fbc766379192a9ca041568cd9360a3c4213bb3018063e88a297e9d1f637fb7ca3ef049a73a258022ec07e42f01a40bdf09a SHA512 8e90b2a1f82f951ab40a53a8af2ab421758ed8244f1881cc7aa71a8d9c2e2e6d892166ec8f8f6182966e56eb28c9aee6a060ee54b559b1d073fba97ad0afb013
23 DIST salt-3002.7.tar.gz 15792124 BLAKE2B b4cb4a6d73c45f3c2183a7adfe8196bbc5788dce1995bd5c640cd9957bdfdba2e96deebaba927d6103fc50f4eaab86d51f4dd4594d25b7357db79ed67b39258e SHA512 c1e7bbcd39b5c2bef351bd74026346bf729839c4161f6eff8162620e9cb08a63073abeeb8af6bab635070386a883df494ef08cc07a84efa9aa7f2160b357a938
24 DIST salt-3003.3.tar.gz 16017984 BLAKE2B 9cd1e33a7b6dff4d3c6c5a87e1204f7f113b6190da8301061e26fcec178aba597a9e17ab60a54a67b52a895a9a8aef58bec70e9fdd8d8edc5a42945f6de21a58 SHA512 4fe50922833fce48fcc679adb16a0e1fe893531b2feb08b235a1461c58b8d9a72af2acd89fc0f712207fb0cd215d6b446e31a40001b46c43d0cc4ac827ce29e3
25 +DIST salt-3003.4.tar.gz 16031515 BLAKE2B 34902aba7ab64f4ddbacbad1b776b9b2218caf22fb843879a80bd5c30b6c28f4c22a050bbaf0e9735507a78c887f52bcae7d1833ffeb51a543ec22fda79252e6 SHA512 35419fbb3f9a0f3e87579f740b717d6902cab0d85397b16d1e94d9516bf5f5d269b4f8bca370fd376abd9b7c8a6ad7ef4c8e8a8fdd31655fd17c810989e79693
26 DIST salt-3003.tar.gz 15830910 BLAKE2B ea4f02eece951c3fb4fcc480d00f7b531ac549b2e23ff9a210b73f749f9ba83e0402e02a59028f41f94958d17512e417b7c1b7015e8ee3aeac55be9b1374fe6f SHA512 7f631466372f303c03f2852a5cfba1ee5c6ba1636a6fe1e1622e90d0b1376ef9f670aa1b4754f3d9c8c7fe1b99fe1b4c49e140dc86d90d157a1ec1e73ba43c38
27 DIST salt-3004.1.tar.gz 17685649 BLAKE2B 64950cdc8420228f935d4a21fc20872da9ecf7c51b866ec3c59b46486b84a739b002acc44fa909eed93ce3dc6bedc9804df05d3d9ee5a9a13cd9d041ba70f876 SHA512 9353a8dc2a1c6e272318c6f35059236c5d78b6c8930f715275b701c12fca3be1fe930eb533f3f0c22933ba60967b0980300b922fe486cee9a62e6cdb568bdf91
28
29 diff --git a/app-admin/salt/files/salt-3003.4-tests.patch b/app-admin/salt/files/salt-3003.4-tests.patch
30 new file mode 100644
31 index 000000000000..93fd4214021b
32 --- /dev/null
33 +++ b/app-admin/salt/files/salt-3003.4-tests.patch
34 @@ -0,0 +1,52 @@
35 +diff --git a/tests/conftest.py b/tests/conftest.py
36 +index 0fc1844bc8..32346da1f6 100644
37 +--- a/tests/conftest.py
38 ++++ b/tests/conftest.py
39 +@@ -34,7 +34,6 @@ import salt.utils.files
40 + import salt.utils.path
41 + import salt.utils.platform
42 + import salt.utils.win_functions
43 +-import saltfactories.utils.compat
44 + from salt.serializers import yaml
45 + from salt.utils.immutabletypes import freeze
46 + from tests.support.helpers import (
47 +@@ -465,9 +464,7 @@ def pytest_runtest_setup(item):
48 + item._skipped_by_mark = True
49 + pytest.skip(PRE_PYTEST_SKIP_REASON)
50 +
51 +- if saltfactories.utils.compat.has_unittest_attr(
52 +- item, "__slow_test__"
53 +- ) or item.get_closest_marker("slow_test"):
54 ++ if item.get_closest_marker("slow_test"):
55 + if item.config.getoption("--run-slow") is False:
56 + item._skipped_by_mark = True
57 + pytest.skip("Slow tests are disabled!")
58 +diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py
59 +index ef7acdb7a3..22953556cb 100644
60 +--- a/tests/unit/utils/test_schema.py
61 ++++ b/tests/unit/utils/test_schema.py
62 +@@ -1,6 +1,8 @@
63 + # pylint: disable=function-redefined
64 + import copy
65 +
66 ++import pytest
67 ++
68 + import salt.utils.json
69 + import salt.utils.schema as schema
70 + import salt.utils.stringutils
71 +@@ -822,6 +824,7 @@ class ConfigTestCase(TestCase):
72 + },
73 + )
74 +
75 ++ @pytest.mark.skip("broken with newer versions of jsonschema")
76 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
77 + def test_hostname_config_validation(self):
78 + class TestConf(schema.Schema):
79 +@@ -2048,6 +2051,7 @@ class ConfigTestCase(TestCase):
80 + item = schema.NotItem(item=schema.BooleanItem())
81 + self.assertEqual(item.serialize(), {"not": item.item.serialize()})
82 +
83 ++ @pytest.mark.skip("broken with newer versions of jsonschema")
84 + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing")
85 + def test_not_config_validation(self):
86 + class TestConf(schema.Schema):
87
88 diff --git a/app-admin/salt/salt-3003.4.ebuild b/app-admin/salt/salt-3003.4.ebuild
89 new file mode 100644
90 index 000000000000..a94b0761731f
91 --- /dev/null
92 +++ b/app-admin/salt/salt-3003.4.ebuild
93 @@ -0,0 +1,204 @@
94 +# Copyright 1999-2022 Gentoo Authors
95 +# Distributed under the terms of the GNU General Public License v2
96 +
97 +EAPI=8
98 +PYTHON_COMPAT=( python3_{8..9} )
99 +
100 +inherit systemd distutils-r1
101 +
102 +DESCRIPTION="Salt is a remote execution and configuration manager"
103 +HOMEPAGE="https://www.saltstack.com/resources/community/
104 + https://github.com/saltstack"
105 +
106 +if [[ ${PV} == 9999* ]]; then
107 + inherit git-r3
108 + EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git"
109 + EGIT_BRANCH="develop"
110 + SRC_URI=""
111 +else
112 + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
113 + KEYWORDS="~amd64 ~arm ~arm64 ~x86"
114 +fi
115 +
116 +LICENSE="Apache-2.0"
117 +SLOT="0"
118 +IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako
119 + mongodb neutron nova openssl portage profile redis selinux test raet
120 + +zeromq vim-syntax"
121 +
122 +RDEPEND="
123 + sys-apps/pciutils
124 + >=dev-python/distro-1.5[${PYTHON_USEDEP}]
125 + dev-python/jinja[${PYTHON_USEDEP}]
126 + dev-python/libnacl[${PYTHON_USEDEP}]
127 + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}]
128 + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}]
129 + dev-python/pyyaml[${PYTHON_USEDEP}]
130 + dev-python/markupsafe[${PYTHON_USEDEP}]
131 + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}]
132 + dev-python/setuptools[${PYTHON_USEDEP}]
133 + >=dev-python/toml-0.10.2[${PYTHON_USEDEP}]
134 + dev-python/watchdog[${PYTHON_USEDEP}]
135 + libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] )
136 + mako? ( dev-python/mako[${PYTHON_USEDEP}] )
137 + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
138 + libvirt? (
139 + $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8)
140 + )
141 + openssl? (
142 + dev-libs/openssl:0=[-bindist(-)]
143 + dev-python/pyopenssl[${PYTHON_USEDEP}]
144 + )
145 + raet? (
146 + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}]
147 + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}]
148 + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}]
149 + )
150 + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] )
151 + cheetah? ( dev-python/cheetah3[${PYTHON_USEDEP}] )
152 + genshi? ( dev-python/genshi[${PYTHON_USEDEP}] )
153 + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] )
154 + portage? ( sys-apps/portage[${PYTHON_USEDEP}] )
155 + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] )
156 + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] )
157 + selinux? ( sec-policy/selinux-salt )
158 + nova? (
159 + $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8)
160 + )
161 + neutron? (
162 + $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8)
163 + )
164 + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] )
165 + profile? ( dev-python/yappi[${PYTHON_USEDEP}] )
166 + vim-syntax? ( app-vim/salt-vim )
167 + zeromq? ( >=dev-python/pyzmq-2.2.0[${PYTHON_USEDEP}] )
168 +"
169 +BDEPEND="
170 + test? (
171 + ${RDEPEND}
172 + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}]
173 + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}]
174 + dev-python/mako[${PYTHON_USEDEP}]
175 + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}]
176 + >=dev-python/moto-1.3.14[${PYTHON_USEDEP}]
177 + dev-python/pip[${PYTHON_USEDEP}]
178 + dev-python/psutil[${PYTHON_USEDEP}]
179 + dev-python/pyopenssl[${PYTHON_USEDEP}]
180 + dev-python/pytest[${PYTHON_USEDEP}]
181 + =dev-python/pytest-salt-factories-0.121*[${PYTHON_USEDEP}]
182 + dev-python/pytest-tempdir[${PYTHON_USEDEP}]
183 + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}]
184 + dev-python/pytest-subtests[${PYTHON_USEDEP}]
185 + dev-python/flaky[${PYTHON_USEDEP}]
186 + dev-python/libcloud[${PYTHON_USEDEP}]
187 + net-dns/bind-tools
188 + >=dev-python/virtualenv-20.0.20[${PYTHON_USEDEP}]
189 + !x86? ( >=dev-python/boto3-1.19.63[${PYTHON_USEDEP}] )
190 + )"
191 +
192 +DOCS=( README.rst AUTHORS )
193 +
194 +REQUIRED_USE="|| ( raet zeromq )
195 + test? ( cheetah genshi )"
196 +RESTRICT="!test? ( test ) x86? ( test )"
197 +
198 +PATCHES=(
199 + "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch"
200 + "${FILESDIR}/salt-3003-gentoolkit-revdep.patch"
201 + "${FILESDIR}/salt-3002-tests.patch"
202 + "${FILESDIR}/salt-3003.3-tests.patch"
203 + "${FILESDIR}/salt-3003.1-tests.patch"
204 + "${FILESDIR}/salt-3004.1-jinja-3.patch"
205 + "${FILESDIR}/salt-3003.4-tests.patch"
206 +)
207 +
208 +python_prepare_all() {
209 + # remove tests with external dependencies that may not be available, and
210 + # tests that don't work in sandbox
211 + rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die
212 + rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die
213 + rm tests/unit/states/test_boto_vpc.py || die
214 + rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die
215 + rm tests/pytests/functional/transport/server/test_req_channel.py || die
216 +
217 + # tests that require network access
218 + rm tests/unit/{states,modules}/test_zcbuildout.py || die
219 + rm -r tests/integration/cloud || die
220 + rm -r tests/kitchen/tests/wordpress/tests || die
221 + rm tests/kitchen/test_kitchen.py || die
222 + rm tests/unit/modules/test_network.py || die
223 +
224 + # tests require root access
225 + rm tests/integration/pillar/test_git_pillar.py || die
226 + rm tests/integration/states/test_supervisord.py || die
227 + rm tests/pytests/unit/client/test_ssh.py || die
228 +
229 + # make sure pkg_resources doesn't bomb because pycrypto isn't installed
230 + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die
231 + # pycryptodome rather than pycryptodomex
232 + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die
233 +
234 + distutils-r1_python_prepare_all
235 +}
236 +
237 +python_prepare() {
238 + einfo "Fixing collections.abc warnings for ${EPYTHON}"
239 + local abc
240 + abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die
241 + find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die
242 +
243 + # removes contextvars, see bug: https://bugs.gentoo.org/799431
244 + sed -i '/^contextvars/d' requirements/base.txt || die
245 +}
246 +
247 +python_install_all() {
248 + local svc
249 + USE_SETUPTOOLS=1 distutils-r1_python_install_all
250 +
251 + for svc in minion master syndic api; do
252 + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc}
253 + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc}
254 + systemd_dounit "${FILESDIR}"/salt-${svc}.service
255 + done
256 +
257 + insinto /etc/${PN}
258 + doins -r conf/*
259 +}
260 +
261 +python_test() {
262 + # testsuite likes lots of files
263 + ulimit -n 4096 || die
264 +
265 + # ${T} is too long a path for the tests to work
266 + local TMPDIR
267 + TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)"
268 + (
269 + export TMPDIR
270 + cleanup() { rm -rf "${TMPDIR}" || die; }
271 +
272 + trap cleanup EXIT
273 +
274 + addwrite "${TMPDIR}"
275 +
276 + USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \
277 + "${EPYTHON}" -m pytest -vv \
278 + || die "testing failed with ${EPYTHON}"
279 + )
280 +}
281 +
282 +pkg_postinst() {
283 + if use python_targets_python3_8; then
284 + if use nova; then
285 + ewarn "Salt's nova functionality will not work with python3.8 since"
286 + ewarn "dev-python/python-novaclient does not support it yet"
287 + fi
288 + if use neutron; then
289 + ewarn "Salt's neutron functionality will not work with python3.8 since"
290 + ewarn "dev-python/python-neutronclient does not support it yet"
291 + fi
292 + if use libvirt; then
293 + ewarn "Salt's libvirt functionality will not work with python3.8 since"
294 + ewarn "dev-python/libvirt-python does not support it yet"
295 + fi
296 + fi
297 +}