1 |
commit: d72aeae041a1c80f6a181596545ba524d91ab421 |
2 |
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 28 16:16:39 2022 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 28 18:24:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d72aeae0 |
7 |
|
8 |
app-admin/salt: add 3004.2 |
9 |
|
10 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
11 |
|
12 |
app-admin/salt/Manifest | 1 + |
13 |
app-admin/salt/files/salt-3004.2-importlib.patch | 11 ++ |
14 |
app-admin/salt/files/salt-3004.2-jinja-3.patch | 14 ++ |
15 |
app-admin/salt/salt-3004.2.ebuild | 208 +++++++++++++++++++++++ |
16 |
4 files changed, 234 insertions(+) |
17 |
|
18 |
diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest |
19 |
index e4b2bec60be3..601fc6fa75d4 100644 |
20 |
--- a/app-admin/salt/Manifest |
21 |
+++ b/app-admin/salt/Manifest |
22 |
@@ -5,3 +5,4 @@ DIST salt-3003.3.tar.gz 16017984 BLAKE2B 9cd1e33a7b6dff4d3c6c5a87e1204f7f113b619 |
23 |
DIST salt-3003.4.tar.gz 16031515 BLAKE2B 34902aba7ab64f4ddbacbad1b776b9b2218caf22fb843879a80bd5c30b6c28f4c22a050bbaf0e9735507a78c887f52bcae7d1833ffeb51a543ec22fda79252e6 SHA512 35419fbb3f9a0f3e87579f740b717d6902cab0d85397b16d1e94d9516bf5f5d269b4f8bca370fd376abd9b7c8a6ad7ef4c8e8a8fdd31655fd17c810989e79693 |
24 |
DIST salt-3003.tar.gz 15830910 BLAKE2B ea4f02eece951c3fb4fcc480d00f7b531ac549b2e23ff9a210b73f749f9ba83e0402e02a59028f41f94958d17512e417b7c1b7015e8ee3aeac55be9b1374fe6f SHA512 7f631466372f303c03f2852a5cfba1ee5c6ba1636a6fe1e1622e90d0b1376ef9f670aa1b4754f3d9c8c7fe1b99fe1b4c49e140dc86d90d157a1ec1e73ba43c38 |
25 |
DIST salt-3004.1.tar.gz 17685649 BLAKE2B 64950cdc8420228f935d4a21fc20872da9ecf7c51b866ec3c59b46486b84a739b002acc44fa909eed93ce3dc6bedc9804df05d3d9ee5a9a13cd9d041ba70f876 SHA512 9353a8dc2a1c6e272318c6f35059236c5d78b6c8930f715275b701c12fca3be1fe930eb533f3f0c22933ba60967b0980300b922fe486cee9a62e6cdb568bdf91 |
26 |
+DIST salt-3004.2.tar.gz 17685127 BLAKE2B a42e31d8a006488b3a6f341f817cde21ff86248d2b548d9914c429c62d7570cdf46cf2b41311cbb08ced7f9518e68156c6df3eb78e55cacfd4d40a4e7a54f52b SHA512 b2fa434f1d25eabac51d65d75bb020943eb71aff113d683e6f436a0f205bd3c7682b1b7acd4d9a62bf37a47eb0561293d263f3174d5e266f0998a1652fcae2ef |
27 |
|
28 |
diff --git a/app-admin/salt/files/salt-3004.2-importlib.patch b/app-admin/salt/files/salt-3004.2-importlib.patch |
29 |
new file mode 100644 |
30 |
index 000000000000..599b17290d5b |
31 |
--- /dev/null |
32 |
+++ b/app-admin/salt/files/salt-3004.2-importlib.patch |
33 |
@@ -0,0 +1,11 @@ |
34 |
+--- a/salt/_compat.py 2022-06-28 01:50:45.630746476 -0000 |
35 |
++++ b/salt/_compat.py 2022-06-28 01:51:52.970217848 -0000 |
36 |
+@@ -14,7 +14,7 @@ |
37 |
+ if sys.version_info >= (3, 10): |
38 |
+ # Python 3.10 will include a fix in importlib.metadata which allows us to |
39 |
+ # get the distribution of a loaded entry-point |
40 |
+- import importlib.metadata # pylint: disable=no-member,no-name-in-module |
41 |
++ import importlib.metadata as importlib_metadata # pylint: disable=no-member,no-name-in-module |
42 |
+ else: |
43 |
+ # importlib_metadata before version 3.3.0 does not include the functionality we need. |
44 |
+ try: |
45 |
|
46 |
diff --git a/app-admin/salt/files/salt-3004.2-jinja-3.patch b/app-admin/salt/files/salt-3004.2-jinja-3.patch |
47 |
new file mode 100644 |
48 |
index 000000000000..271921fd4564 |
49 |
--- /dev/null |
50 |
+++ b/app-admin/salt/files/salt-3004.2-jinja-3.patch |
51 |
@@ -0,0 +1,14 @@ |
52 |
+diff --git a/tests/unit/utils/test_jinja.py b/tests/unit/utils/test_jinja.py |
53 |
+index 6502831aff..dec847364a 100644 |
54 |
+--- a/tests/unit/utils/test_jinja.py |
55 |
++++ b/tests/unit/utils/test_jinja.py |
56 |
+@@ -22,7 +22,8 @@ import salt.utils.files |
57 |
+ import salt.utils.json |
58 |
+ import salt.utils.stringutils |
59 |
+ import salt.utils.yaml |
60 |
+-from jinja2 import DictLoader, Environment, Markup, exceptions |
61 |
++from jinja2 import DictLoader, Environment, exceptions |
62 |
++from markupsafe import Markup |
63 |
+ from salt.exceptions import SaltRenderError |
64 |
+ from salt.utils.decorators.jinja import JinjaFilter |
65 |
+ from salt.utils.jinja import ( |
66 |
|
67 |
diff --git a/app-admin/salt/salt-3004.2.ebuild b/app-admin/salt/salt-3004.2.ebuild |
68 |
new file mode 100644 |
69 |
index 000000000000..dcc6f23bd8b9 |
70 |
--- /dev/null |
71 |
+++ b/app-admin/salt/salt-3004.2.ebuild |
72 |
@@ -0,0 +1,208 @@ |
73 |
+# Copyright 1999-2022 Gentoo Authors |
74 |
+# Distributed under the terms of the GNU General Public License v2 |
75 |
+ |
76 |
+EAPI=8 |
77 |
+PYTHON_COMPAT=( python3_{8..10} ) |
78 |
+ |
79 |
+inherit systemd distutils-r1 |
80 |
+ |
81 |
+DESCRIPTION="Salt is a remote execution and configuration manager" |
82 |
+HOMEPAGE="https://www.saltstack.com/resources/community/ |
83 |
+ https://github.com/saltstack" |
84 |
+ |
85 |
+if [[ ${PV} == 9999* ]]; then |
86 |
+ inherit git-r3 |
87 |
+ EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git" |
88 |
+ EGIT_BRANCH="develop" |
89 |
+ SRC_URI="" |
90 |
+else |
91 |
+ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
92 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" |
93 |
+fi |
94 |
+ |
95 |
+LICENSE="Apache-2.0" |
96 |
+SLOT="0" |
97 |
+IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako |
98 |
+ mongodb neutron nova openssl portage profile redis selinux test raet |
99 |
+ +zeromq vim-syntax" |
100 |
+ |
101 |
+RDEPEND=" |
102 |
+ sys-apps/pciutils |
103 |
+ >=dev-python/distro-1.5[${PYTHON_USEDEP}] |
104 |
+ >=dev-python/jinja-3.0[${PYTHON_USEDEP}] |
105 |
+ dev-python/libnacl[${PYTHON_USEDEP}] |
106 |
+ >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}] |
107 |
+ >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}] |
108 |
+ >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}] |
109 |
+ dev-python/pyyaml[${PYTHON_USEDEP}] |
110 |
+ dev-python/markupsafe[${PYTHON_USEDEP}] |
111 |
+ >=dev-python/requests-1.0.0[${PYTHON_USEDEP}] |
112 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
113 |
+ >=dev-python/toml-0.10.2[${PYTHON_USEDEP}] |
114 |
+ dev-python/watchdog[${PYTHON_USEDEP}] |
115 |
+ libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] ) |
116 |
+ mako? ( dev-python/mako[${PYTHON_USEDEP}] ) |
117 |
+ ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) |
118 |
+ libvirt? ( |
119 |
+ $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8) |
120 |
+ ) |
121 |
+ openssl? ( |
122 |
+ dev-libs/openssl:0=[-bindist(-)] |
123 |
+ dev-python/pyopenssl[${PYTHON_USEDEP}] |
124 |
+ ) |
125 |
+ raet? ( |
126 |
+ >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}] |
127 |
+ >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}] |
128 |
+ >=dev-python/raet-0.6.0[${PYTHON_USEDEP}] |
129 |
+ ) |
130 |
+ cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] ) |
131 |
+ cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] ) |
132 |
+ genshi? ( dev-python/genshi[${PYTHON_USEDEP}] ) |
133 |
+ mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] ) |
134 |
+ portage? ( sys-apps/portage[${PYTHON_USEDEP}] ) |
135 |
+ keyring? ( dev-python/keyring[${PYTHON_USEDEP}] ) |
136 |
+ redis? ( dev-python/redis-py[${PYTHON_USEDEP}] ) |
137 |
+ selinux? ( sec-policy/selinux-salt ) |
138 |
+ nova? ( |
139 |
+ $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8) |
140 |
+ ) |
141 |
+ neutron? ( |
142 |
+ $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8) |
143 |
+ ) |
144 |
+ gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] ) |
145 |
+ profile? ( dev-python/yappi[${PYTHON_USEDEP}] ) |
146 |
+ vim-syntax? ( app-vim/salt-vim ) |
147 |
+ zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] ) |
148 |
+" |
149 |
+BDEPEND=" |
150 |
+ test? ( |
151 |
+ ${RDEPEND} |
152 |
+ >=dev-python/boto-2.32.1[${PYTHON_USEDEP}] |
153 |
+ >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}] |
154 |
+ dev-python/mako[${PYTHON_USEDEP}] |
155 |
+ >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] |
156 |
+ >=dev-python/moto-0.3.6[${PYTHON_USEDEP}] |
157 |
+ dev-python/passlib |
158 |
+ dev-python/pip[${PYTHON_USEDEP}] |
159 |
+ dev-python/pyopenssl[${PYTHON_USEDEP}] |
160 |
+ dev-python/pytest[${PYTHON_USEDEP}] |
161 |
+ >=dev-python/pytest-salt-factories-1.0.0_rc13[${PYTHON_USEDEP}] |
162 |
+ dev-python/pytest-tempdir[${PYTHON_USEDEP}] |
163 |
+ dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}] |
164 |
+ dev-python/pytest-subtests[${PYTHON_USEDEP}] |
165 |
+ dev-python/flaky[${PYTHON_USEDEP}] |
166 |
+ dev-python/libcloud[${PYTHON_USEDEP}] |
167 |
+ net-dns/bind-tools |
168 |
+ >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}] |
169 |
+ !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] ) |
170 |
+ )" |
171 |
+ |
172 |
+DOCS=( README.rst AUTHORS ) |
173 |
+ |
174 |
+REQUIRED_USE="|| ( raet zeromq ) |
175 |
+ test? ( cheetah genshi )" |
176 |
+RESTRICT="!test? ( test ) x86? ( test )" |
177 |
+ |
178 |
+PATCHES=( |
179 |
+ "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch" |
180 |
+ "${FILESDIR}/salt-3003-gentoolkit-revdep.patch" |
181 |
+ "${FILESDIR}/salt-3002-tests.patch" |
182 |
+ "${FILESDIR}/salt-3003.1-tests.patch" |
183 |
+ "${FILESDIR}/salt-3004.2-jinja-3.patch" |
184 |
+ "${FILESDIR}/salt-3004.1-tests.patch" |
185 |
+ "${FILESDIR}/salt-3004.1-relax-pyzmq-dep.patch" |
186 |
+ "${FILESDIR}/salt-3004.1-py310.patch" |
187 |
+ "${FILESDIR}/salt-3004.2-importlib.patch" |
188 |
+) |
189 |
+ |
190 |
+python_prepare_all() { |
191 |
+ # remove tests with external dependencies that may not be available, and |
192 |
+ # tests that don't work in sandbox |
193 |
+ rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die |
194 |
+ rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die |
195 |
+ rm tests/unit/states/test_boto_vpc.py || die |
196 |
+ rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die |
197 |
+ rm tests/pytests/functional/transport/server/test_req_channel.py || die |
198 |
+ |
199 |
+ # tests that require network access |
200 |
+ rm tests/unit/{states,modules}/test_zcbuildout.py || die |
201 |
+ rm -r tests/integration/cloud || die |
202 |
+ rm -r tests/kitchen/tests/wordpress/tests || die |
203 |
+ rm tests/kitchen/test_kitchen.py || die |
204 |
+ rm tests/unit/modules/test_network.py || die |
205 |
+ rm tests/pytests/functional/modules/test_pip.py || die |
206 |
+ rm tests/pytests/unit/client/ssh/test_ssh.py || die |
207 |
+ |
208 |
+ # tests require root access |
209 |
+ rm tests/integration/pillar/test_git_pillar.py || die |
210 |
+ rm tests/integration/states/test_supervisord.py || die |
211 |
+ |
212 |
+ # make sure pkg_resources doesn't bomb because pycrypto isn't installed |
213 |
+ find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die |
214 |
+ # pycryptodome rather than pycryptodomex |
215 |
+ find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die |
216 |
+ |
217 |
+ distutils-r1_python_prepare_all |
218 |
+} |
219 |
+ |
220 |
+python_prepare() { |
221 |
+ einfo "Fixing collections.abc warnings for ${EPYTHON}" |
222 |
+ local abc |
223 |
+ abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die |
224 |
+ find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die |
225 |
+ |
226 |
+ # removes contextvars, see bug: https://bugs.gentoo.org/799431 |
227 |
+ sed -i '/^contextvars/d' requirements/base.txt || die |
228 |
+} |
229 |
+ |
230 |
+python_install_all() { |
231 |
+ local svc |
232 |
+ USE_SETUPTOOLS=1 distutils-r1_python_install_all |
233 |
+ |
234 |
+ for svc in minion master syndic api; do |
235 |
+ newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc} |
236 |
+ newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc} |
237 |
+ systemd_dounit "${FILESDIR}"/salt-${svc}.service |
238 |
+ done |
239 |
+ |
240 |
+ insinto /etc/${PN} |
241 |
+ doins -r conf/* |
242 |
+} |
243 |
+ |
244 |
+python_test() { |
245 |
+ # testsuite likes lots of files |
246 |
+ ulimit -n 4096 || die |
247 |
+ |
248 |
+ # ${T} is too long a path for the tests to work |
249 |
+ local TMPDIR |
250 |
+ TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)" |
251 |
+ ( |
252 |
+ export TMPDIR |
253 |
+ cleanup() { rm -rf "${TMPDIR}" || die; } |
254 |
+ |
255 |
+ trap cleanup EXIT |
256 |
+ |
257 |
+ addwrite "${TMPDIR}" |
258 |
+ |
259 |
+ USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \ |
260 |
+ "${EPYTHON}" -m pytest -vv \ |
261 |
+ || die "testing failed with ${EPYTHON}" |
262 |
+ ) |
263 |
+} |
264 |
+ |
265 |
+pkg_postinst() { |
266 |
+ if use python_targets_python3_8; then |
267 |
+ if use nova; then |
268 |
+ ewarn "Salt's nova functionality will not work with python3.8 since" |
269 |
+ ewarn "dev-python/python-novaclient does not support it yet" |
270 |
+ fi |
271 |
+ if use neutron; then |
272 |
+ ewarn "Salt's neutron functionality will not work with python3.8 since" |
273 |
+ ewarn "dev-python/python-neutronclient does not support it yet" |
274 |
+ fi |
275 |
+ if use libvirt; then |
276 |
+ ewarn "Salt's libvirt functionality will not work with python3.8 since" |
277 |
+ ewarn "dev-python/libvirt-python does not support it yet" |
278 |
+ fi |
279 |
+ fi |
280 |
+} |