From 752d6256e5204b958b0ef7905675a940b5e9172f Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 12 May 2022 16:42:50 +0300 Subject: gentoo resync : 12.05.2022 --- app-admin/salt/Manifest | 5 +- app-admin/salt/files/salt-3004.1-py310.patch | 53 +++++++ app-admin/salt/files/salt-3004.1-tests.patch | 20 +++ app-admin/salt/salt-3004.1-r2.ebuild | 205 -------------------------- app-admin/salt/salt-3004.1-r4.ebuild | 207 +++++++++++++++++++++++++++ 5 files changed, 283 insertions(+), 207 deletions(-) create mode 100644 app-admin/salt/files/salt-3004.1-py310.patch delete mode 100644 app-admin/salt/salt-3004.1-r2.ebuild create mode 100644 app-admin/salt/salt-3004.1-r4.ebuild (limited to 'app-admin/salt') diff --git a/app-admin/salt/Manifest b/app-admin/salt/Manifest index c33c18f9d9ec..b2f5e3e211b7 100644 --- a/app-admin/salt/Manifest +++ b/app-admin/salt/Manifest @@ -30,8 +30,9 @@ AUX salt-3003.3-tests.patch 9888 BLAKE2B b8785f6498246e3a61079721c060aebda15a595 AUX salt-3003.4-relax-pyzmq-dep.patch 333 BLAKE2B 31596e398c420e04802f086e61ff59676a9687c199df0f7fcb9c7e6a804a3339e1c1960a0579cae0022f90c0e1a274aa90916b7a685239b54d47851246acbe1f SHA512 e9796a8cb0bcdc9d90f8a3d4e01d955a2ac1129edc3d572be7ddd472fd488bae933e80f6a107471c6660b61a16d9034cf4a80c7b8103a2c0b26b4392f5c70286 AUX salt-3003.4-tests.patch 1982 BLAKE2B 920f9c7e587358cff0abf97f2dfe54ee523f82a35c238d193520e6bd30921cec993705dd93d0c8130d4794fe051e7236411afa552d311f2dcc30596c1bac2b51 SHA512 700cb7e9020383b0684898e4a6675174e552bed1ba7540cb773303ec151574707d142b888a99d5288e18236cf0d47169f1515041e4e6ca91204a0bc140f66898 AUX salt-3004.1-jinja-3.patch 1638 BLAKE2B 3270b3547fe526dc178330e637aa16a363d483b4d17ac32f1d91bdfa47d917108d7dc032b0ad67d294868a131d2383ef660e7e04e961b4fd0c0d7229357809f3 SHA512 533c5b093e6ee7c6fe1808b9a7a914281cafe71cdd781e48dba38075ca079311c0916f6a8cc754ed90c3a21cc07d169523fe3ec86af759c03d874a9e21637a92 +AUX salt-3004.1-py310.patch 2071 BLAKE2B 23f8db2e2bc7307fd58e535bf642e9c76172d03d49b3e86333ee82434adbaa5f437330fa951221f233bba9e09b514611180d19f1db2856ba7d0a3a231a4b385f SHA512 6eec860778ceab15f5ea4260b648cd96df52daaec900dd093257af97e873e8a5be1296d4181767846eb63277a0b903e92ab6550772046acd7a8dea72eb0447f8 AUX salt-3004.1-relax-pyzmq-dep.patch 348 BLAKE2B 75a5947cf6f92fd08da25d50b9064d82c13eaf9f2f2f4ed627f8690ba8893b58de7ef2f0a976879ce94f8f542b9198c637021ba08bc067f3eb56aa40e9598c75 SHA512 7c48d3f86cd81d11077c80ca9536a85c9825299dd9c2a81fd43fc2c2781211d9bb72e4dd79381343851c3292210eab41de049006e608ceb340af31a84cd244bb -AUX salt-3004.1-tests.patch 12128 BLAKE2B dfdabd99aeae7d8d398c0232b638f048673daf7b222efbe948ed6411b16ef5910199c8ceaa647abf612f711d2b7e07ea5ab8cdcbe796c4fdfa8f20a80355265e SHA512 b7e922c1008118a93120d374f66ea711919e9853365ae66e5ab5b52044f0c0ecff48821342b012d68ca0e4bb28d11a8c0a438ba3ecb1cc7cde88f777a72b299c +AUX salt-3004.1-tests.patch 13025 BLAKE2B fd86808b3d43a25abb88f5d454dd2618d896aa8c8ff843d4f9b46ff32d98d07d245d308599d0a93814d80ff9b1cb120da4296b6f06f64825da4ce603ec37d4fb SHA512 4634fe96479c481fdb9daf8decd3632e9ed8daa9ab62942d71bd6c11e603ae5ac96acfdb68e4e91ec2c829efd33689fa122bc53979b7b5ce02ea63189bebe349 AUX salt-api.service 166 BLAKE2B 32d28ef4ef3c60942bed3fa3a01d70a9af387705844326cdf9339d7c887238a1e6817d78ffd1cb205a6397a2138c2389ea00bf53be84a17b23bea140279bf42c SHA512 bab6b8380c965bf16e23078ebe6f38d942300829d4c89ddf23b630bd57b4d371f80687d85dd9e0cc1b669f2ca882aecde1bc8d7d82382a02ed20e493d3f04702 AUX salt-master.service 169 BLAKE2B 15e7a4f64cfa75eb8d8576a7d0b61ea0c9937c94fd2130fd6c123a82187f08b5ed533c168a7310fd94d9bd2cecf9d0ba94665c653a971ef61e5e18ffdf087a15 SHA512 87fe27fc0748f4191bd1c6883bb362c95cce8fe1f409e2679b229ddfd9de6c99438859dfa0a47b042977d659029ef56e406f1e8aa01761bff21af4784f9dd5f8 AUX salt-minion.service 162 BLAKE2B 6f7b6b72e26d1651dbcb324b1e0cfef9f4b5a794f40566297c5bc469b351587db4d9805bed124774107efb64e6ed3e25fefa899b42a38064ee6fe26fd990ae58 SHA512 99f0a5c696e38b42b283416736a23e535ccc53095928b205914cf4b69c0df931a6752205985726527f7889b01dfece78466be28448458b15064edd04aca3e5ed @@ -57,5 +58,5 @@ EBUILD salt-3003-r1.ebuild 6580 BLAKE2B ba2d5c5a2461694213918dc4d7cb88600235b1b1 EBUILD salt-3003.3-r1.ebuild 6842 BLAKE2B d273b5b3a717022a75cc83563f9d0f8412c5250f062312be30c36560faf1250ca64382b4cc4f4e180196217b97158090dd7593a4f4e450904840f5a7d4c88104 SHA512 46aa981c49279c984d622bd38782099919845fa47597eb343a8a40bdcbf76ac29e1377c09ee4c33b6d6930e789c34bafeef308094adc873646be5805b7710f6f EBUILD salt-3003.3.ebuild 6801 BLAKE2B 5146a9a20ca1de9ef167f896df8cafea100a1b5245d747aea685a6811151c3909040c3cf53d80ed5eb7359e76914a5fdf94ad8af8d643995d46c727d9163cc66 SHA512 95a055ce3a69a358bfdd221f139b86964a7ce5ea18d3f12b9270bcb03f4873cdab55b738338165b785d039f869096928758a8ccb1c0c6a87c3e1897da0a89ae6 EBUILD salt-3003.4-r1.ebuild 6933 BLAKE2B c99f429003c7992c9b9271413ce4929c2e4a3fb49d3dae818a37a7e9253165cce99625a4c298cd6065781564eb1b838edc5cfca437dbc7103878131bc5de1671 SHA512 52719d14b8bbdd55c4f4aff007733cf5a889339d6187caeb5c57a5a2bd53b999b910dda0213db50fc5224f0e01f9380ada63c1e8f344530ea60d6f6cbb9498d0 -EBUILD salt-3004.1-r2.ebuild 6979 BLAKE2B 08ba611b65f5a5d1ae39591412b032a8733b1fa21f9678dcc36b81bdfb23a1faddec337c6684f903d1d1305dd31ba9af0d977ec16ccd0b6f475fb93b2822467c SHA512 6990cbfd7c3b497ad7f599465f3dc5fcc6979b320c1e9b635cfb0901e6b18e7ffdd08f4e9468479f57080bd370fdca9a3f1606861ed130fe5c218db3b20fb7c4 +EBUILD salt-3004.1-r4.ebuild 7037 BLAKE2B b7403a697abe6d6c327e3df54723f7604504adca6b9411b5a9ae16a354d55c7360040dec12475fbdcef18a50d4bf29f0d48575b766459ffe4cefd8da65bc50d4 SHA512 d6f6b0583edb0c85de6315a7a679010b7409a594eeb709c61c17d579c1b4c0d9921059dc2f99f2bc92092266945ad24c83817615b84a36cd033ea4143268d522 MISC metadata.xml 2362 BLAKE2B 60fd7a02823e610b4d12b1d4c6a066cf16f8ef4094397553381d62bc027715164f02ccad4c86e431a30822d5c4c25e4eebd814f99e43b7a45bc08a3fd885cfee SHA512 4aa7549a76e69233949c68841bfcdba6630eeb78a507f20119469f7835a6532b737f41d117c09b1e4c7574f95dec759deacf5d5482be961755d63a19b9eee9a7 diff --git a/app-admin/salt/files/salt-3004.1-py310.patch b/app-admin/salt/files/salt-3004.1-py310.patch new file mode 100644 index 000000000000..7e30d7687a66 --- /dev/null +++ b/app-admin/salt/files/salt-3004.1-py310.patch @@ -0,0 +1,53 @@ +From a58bbbe058df8f45872c43a95992f6a7a7914ab9 Mon Sep 17 00:00:00 2001 +From: piterpunk +Date: Fri, 15 Oct 2021 11:03:20 -0300 +Subject: [PATCH] Fix _compat.py importlib logic for Python 3.10 + +Use the same logic in _compat.py and entrypoints.py to load +the same importlib.metadata. Python's built in implementation for +Python >= 3.10 and the Salt one for others. +--- + salt/_compat.py | 30 +++++++++++++++++------------- + 1 file changed, 17 insertions(+), 13 deletions(-) + +diff --git a/salt/_compat.py b/salt/_compat.py +index 8149657bea61..a402f17a3c71 100644 +--- a/salt/_compat.py ++++ b/salt/_compat.py +@@ -11,19 +11,23 @@ + else: + import salt.ext.ipaddress as ipaddress + ++if sys.version_info >= (3, 10): ++ # Python 3.10 will include a fix in importlib.metadata which allows us to ++ # get the distribution of a loaded entry-point ++ import importlib.metadata # pylint: disable=no-member,no-name-in-module ++else: ++ # importlib_metadata before version 3.3.0 does not include the functionality we need. ++ try: ++ import importlib_metadata + +-# importlib_metadata before version 3.3.0 does not include the functionality we need. +-try: +- import importlib_metadata +- +- importlib_metadata_version = [ +- int(part) +- for part in importlib_metadata.version("importlib_metadata").split(".") +- if part.isdigit() +- ] +- if tuple(importlib_metadata_version) < (3, 3, 0): ++ importlib_metadata_version = [ ++ int(part) ++ for part in importlib_metadata.version("importlib_metadata").split(".") ++ if part.isdigit() ++ ] ++ if tuple(importlib_metadata_version) < (3, 3, 0): ++ # Use the vendored importlib_metadata ++ import salt.ext.importlib_metadata as importlib_metadata ++ except ImportError: + # Use the vendored importlib_metadata + import salt.ext.importlib_metadata as importlib_metadata +-except ImportError: +- # Use the vendored importlib_metadata +- import salt.ext.importlib_metadata as importlib_metadata diff --git a/app-admin/salt/files/salt-3004.1-tests.patch b/app-admin/salt/files/salt-3004.1-tests.patch index 3a36977246f2..956cf1b0041c 100644 --- a/app-admin/salt/files/salt-3004.1-tests.patch +++ b/app-admin/salt/files/salt-3004.1-tests.patch @@ -289,3 +289,23 @@ index 907c67f477..3f68cfe8f3 100644 def test_jid_option_invalid(self): jid = salt.utils.jid.gen_jid({}) + "A" args = ["--jid", jid] + self.args +diff --git a/tests/unit/utils/test_schema.py b/tests/unit/utils/test_schema.py +index 8c648f5288..74b9bc6981 100644 +--- a/tests/unit/utils/test_schema.py ++++ b/tests/unit/utils/test_schema.py +@@ -872,6 +872,7 @@ class ConfigTestCase(TestCase): + }, + ) + ++ @skipIf(True, "Does not work in network sandbox") + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing") + def test_hostname_config_validation(self): + class TestConf(schema.Schema): +@@ -2098,6 +2099,7 @@ class ConfigTestCase(TestCase): + item = schema.NotItem(item=schema.BooleanItem()) + self.assertEqual(item.serialize(), {"not": item.item.serialize()}) + ++ @skipIf(True, "Does not work in network sandbox") + @skipIf(HAS_JSONSCHEMA is False, "The 'jsonschema' library is missing") + def test_not_config_validation(self): + class TestConf(schema.Schema): diff --git a/app-admin/salt/salt-3004.1-r2.ebuild b/app-admin/salt/salt-3004.1-r2.ebuild deleted file mode 100644 index 38244a2fee60..000000000000 --- a/app-admin/salt/salt-3004.1-r2.ebuild +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 -PYTHON_COMPAT=( python3_{8..10} ) - -inherit systemd distutils-r1 - -DESCRIPTION="Salt is a remote execution and configuration manager" -HOMEPAGE="https://www.saltstack.com/resources/community/ - https://github.com/saltstack" - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git" - EGIT_BRANCH="develop" - SRC_URI="" -else - SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" - KEYWORDS="~amd64 ~arm ~arm64 ~x86" -fi - -LICENSE="Apache-2.0" -SLOT="0" -IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako - mongodb neutron nova openssl portage profile redis selinux test raet - +zeromq vim-syntax" - -RDEPEND=" - sys-apps/pciutils - >=dev-python/distro-1.5[${PYTHON_USEDEP}] - >=dev-python/jinja-3.0[${PYTHON_USEDEP}] - dev-python/libnacl[${PYTHON_USEDEP}] - >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}] - >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}] - >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}] - dev-python/pyyaml[${PYTHON_USEDEP}] - dev-python/markupsafe[${PYTHON_USEDEP}] - >=dev-python/requests-1.0.0[${PYTHON_USEDEP}] - dev-python/setuptools[${PYTHON_USEDEP}] - >=dev-python/toml-0.10.2[${PYTHON_USEDEP}] - dev-python/watchdog[${PYTHON_USEDEP}] - libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] ) - mako? ( dev-python/mako[${PYTHON_USEDEP}] ) - ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) - libvirt? ( - $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8) - ) - openssl? ( - dev-libs/openssl:0=[-bindist(-)] - dev-python/pyopenssl[${PYTHON_USEDEP}] - ) - raet? ( - >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}] - >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}] - >=dev-python/raet-0.6.0[${PYTHON_USEDEP}] - ) - cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] ) - cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] ) - genshi? ( dev-python/genshi[${PYTHON_USEDEP}] ) - mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] ) - portage? ( sys-apps/portage[${PYTHON_USEDEP}] ) - keyring? ( dev-python/keyring[${PYTHON_USEDEP}] ) - redis? ( dev-python/redis-py[${PYTHON_USEDEP}] ) - selinux? ( sec-policy/selinux-salt ) - nova? ( - $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8) - ) - neutron? ( - $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8) - ) - gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] ) - profile? ( dev-python/yappi[${PYTHON_USEDEP}] ) - vim-syntax? ( app-vim/salt-vim ) - zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] ) -" -BDEPEND=" - test? ( - ${RDEPEND} - >=dev-python/boto-2.32.1[${PYTHON_USEDEP}] - >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}] - dev-python/mako[${PYTHON_USEDEP}] - >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] - >=dev-python/moto-0.3.6[${PYTHON_USEDEP}] - dev-python/pip[${PYTHON_USEDEP}] - dev-python/pyopenssl[${PYTHON_USEDEP}] - dev-python/pytest[${PYTHON_USEDEP}] - >=dev-python/pytest-salt-factories-1.0.0_rc13[${PYTHON_USEDEP}] - dev-python/pytest-tempdir[${PYTHON_USEDEP}] - dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}] - dev-python/pytest-subtests[${PYTHON_USEDEP}] - dev-python/flaky[${PYTHON_USEDEP}] - dev-python/libcloud[${PYTHON_USEDEP}] - net-dns/bind-tools - >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}] - !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] ) - )" - -DOCS=( README.rst AUTHORS ) - -REQUIRED_USE="|| ( raet zeromq ) - test? ( cheetah genshi )" -RESTRICT="!test? ( test ) x86? ( test )" - -PATCHES=( - "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch" - "${FILESDIR}/salt-3003-gentoolkit-revdep.patch" - "${FILESDIR}/salt-3002-tests.patch" - "${FILESDIR}/salt-3003.1-tests.patch" - "${FILESDIR}/salt-3004.1-jinja-3.patch" - "${FILESDIR}/salt-3004.1-tests.patch" - "${FILESDIR}/salt-3004.1-relax-pyzmq-dep.patch" -) - -python_prepare_all() { - # remove tests with external dependencies that may not be available, and - # tests that don't work in sandbox - rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die - rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die - rm tests/unit/states/test_boto_vpc.py || die - rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die - rm tests/pytests/functional/transport/server/test_req_channel.py || die - - # tests that require network access - rm tests/unit/{states,modules}/test_zcbuildout.py || die - rm -r tests/integration/cloud || die - rm -r tests/kitchen/tests/wordpress/tests || die - rm tests/kitchen/test_kitchen.py || die - rm tests/unit/modules/test_network.py || die - rm tests/pytests/functional/modules/test_pip.py || die - rm tests/pytests/unit/client/ssh/test_ssh.py || die - - # tests require root access - rm tests/integration/pillar/test_git_pillar.py || die - rm tests/integration/states/test_supervisord.py || die - - # make sure pkg_resources doesn't bomb because pycrypto isn't installed - find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die - # pycryptodome rather than pycryptodomex - find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die - - distutils-r1_python_prepare_all -} - -python_prepare() { - einfo "Fixing collections.abc warnings for ${EPYTHON}" - local abc - abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die - find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die - - # removes contextvars, see bug: https://bugs.gentoo.org/799431 - sed -i '/^contextvars/d' requirements/base.txt || die -} - -python_install_all() { - local svc - USE_SETUPTOOLS=1 distutils-r1_python_install_all - - for svc in minion master syndic api; do - newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc} - newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc} - systemd_dounit "${FILESDIR}"/salt-${svc}.service - done - - insinto /etc/${PN} - doins -r conf/* -} - -python_test() { - # testsuite likes lots of files - ulimit -n 4096 || die - - # ${T} is too long a path for the tests to work - local TMPDIR - TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)" - ( - export TMPDIR - cleanup() { rm -rf "${TMPDIR}" || die; } - - trap cleanup EXIT - - addwrite "${TMPDIR}" - - USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \ - "${EPYTHON}" -m pytest -vv \ - || die "testing failed with ${EPYTHON}" - ) -} - -pkg_postinst() { - if use python_targets_python3_8; then - if use nova; then - ewarn "Salt's nova functionality will not work with python3.8 since" - ewarn "dev-python/python-novaclient does not support it yet" - fi - if use neutron; then - ewarn "Salt's neutron functionality will not work with python3.8 since" - ewarn "dev-python/python-neutronclient does not support it yet" - fi - if use libvirt; then - ewarn "Salt's libvirt functionality will not work with python3.8 since" - ewarn "dev-python/libvirt-python does not support it yet" - fi - fi -} diff --git a/app-admin/salt/salt-3004.1-r4.ebuild b/app-admin/salt/salt-3004.1-r4.ebuild new file mode 100644 index 000000000000..e33415b59625 --- /dev/null +++ b/app-admin/salt/salt-3004.1-r4.ebuild @@ -0,0 +1,207 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +PYTHON_COMPAT=( python3_{8..10} ) + +inherit systemd distutils-r1 + +DESCRIPTION="Salt is a remote execution and configuration manager" +HOMEPAGE="https://www.saltstack.com/resources/community/ + https://github.com/saltstack" + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/${PN}stack/${PN}.git" + EGIT_BRANCH="develop" + SRC_URI="" +else + SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + KEYWORDS="amd64 ~arm ~arm64 x86" +fi + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="cheetah cherrypy ldap libcloud libvirt genshi gnupg keyring mako + mongodb neutron nova openssl portage profile redis selinux test raet + +zeromq vim-syntax" + +RDEPEND=" + sys-apps/pciutils + >=dev-python/distro-1.5[${PYTHON_USEDEP}] + >=dev-python/jinja-3.0[${PYTHON_USEDEP}] + dev-python/libnacl[${PYTHON_USEDEP}] + >=dev-python/msgpack-1.0.0[${PYTHON_USEDEP}] + >=dev-python/psutil-5.0.0[${PYTHON_USEDEP}] + >=dev-python/pycryptodome-3.9.8[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/markupsafe[${PYTHON_USEDEP}] + >=dev-python/requests-1.0.0[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + >=dev-python/toml-0.10.2[${PYTHON_USEDEP}] + dev-python/watchdog[${PYTHON_USEDEP}] + libcloud? ( >=dev-python/libcloud-2.5.0[${PYTHON_USEDEP}] ) + mako? ( dev-python/mako[${PYTHON_USEDEP}] ) + ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] ) + libvirt? ( + $(python_gen_cond_dep 'dev-python/libvirt-python[${PYTHON_USEDEP}]' python3_8) + ) + openssl? ( + dev-libs/openssl:0=[-bindist(-)] + dev-python/pyopenssl[${PYTHON_USEDEP}] + ) + raet? ( + >=dev-python/libnacl-1.0.0[${PYTHON_USEDEP}] + >=dev-python/ioflo-1.1.7[${PYTHON_USEDEP}] + >=dev-python/raet-0.6.0[${PYTHON_USEDEP}] + ) + cherrypy? ( >=dev-python/cherrypy-3.2.2[${PYTHON_USEDEP}] ) + cheetah? ( >=dev-python/cheetah3-3.2.2[${PYTHON_USEDEP}] ) + genshi? ( dev-python/genshi[${PYTHON_USEDEP}] ) + mongodb? ( dev-python/pymongo[${PYTHON_USEDEP}] ) + portage? ( sys-apps/portage[${PYTHON_USEDEP}] ) + keyring? ( dev-python/keyring[${PYTHON_USEDEP}] ) + redis? ( dev-python/redis-py[${PYTHON_USEDEP}] ) + selinux? ( sec-policy/selinux-salt ) + nova? ( + $(python_gen_cond_dep '>=dev-python/python-novaclient-2.17.0[${PYTHON_USEDEP}]' python3_8) + ) + neutron? ( + $(python_gen_cond_dep '>=dev-python/python-neutronclient-2.3.6[${PYTHON_USEDEP}]' python3_8) + ) + gnupg? ( dev-python/python-gnupg[${PYTHON_USEDEP}] ) + profile? ( dev-python/yappi[${PYTHON_USEDEP}] ) + vim-syntax? ( app-vim/salt-vim ) + zeromq? ( >=dev-python/pyzmq-19.0.0[${PYTHON_USEDEP}] ) +" +BDEPEND=" + test? ( + ${RDEPEND} + >=dev-python/boto-2.32.1[${PYTHON_USEDEP}] + >=dev-python/jsonschema-3.0[${PYTHON_USEDEP}] + dev-python/mako[${PYTHON_USEDEP}] + >=dev-python/mock-2.0.0[${PYTHON_USEDEP}] + >=dev-python/moto-0.3.6[${PYTHON_USEDEP}] + dev-python/passlib + dev-python/pip[${PYTHON_USEDEP}] + dev-python/pyopenssl[${PYTHON_USEDEP}] + dev-python/pytest[${PYTHON_USEDEP}] + >=dev-python/pytest-salt-factories-1.0.0_rc13[${PYTHON_USEDEP}] + dev-python/pytest-tempdir[${PYTHON_USEDEP}] + dev-python/pytest-helpers-namespace[${PYTHON_USEDEP}] + dev-python/pytest-subtests[${PYTHON_USEDEP}] + dev-python/flaky[${PYTHON_USEDEP}] + dev-python/libcloud[${PYTHON_USEDEP}] + net-dns/bind-tools + >=dev-python/virtualenv-20.3.0[${PYTHON_USEDEP}] + !x86? ( >=dev-python/boto3-1.17.67[${PYTHON_USEDEP}] ) + )" + +DOCS=( README.rst AUTHORS ) + +REQUIRED_USE="|| ( raet zeromq ) + test? ( cheetah genshi )" +RESTRICT="!test? ( test ) x86? ( test )" + +PATCHES=( + "${FILESDIR}/salt-3003-skip-tests-that-oom-machine.patch" + "${FILESDIR}/salt-3003-gentoolkit-revdep.patch" + "${FILESDIR}/salt-3002-tests.patch" + "${FILESDIR}/salt-3003.1-tests.patch" + "${FILESDIR}/salt-3004.1-jinja-3.patch" + "${FILESDIR}/salt-3004.1-tests.patch" + "${FILESDIR}/salt-3004.1-relax-pyzmq-dep.patch" + "${FILESDIR}/salt-3004.1-py310.patch" +) + +python_prepare_all() { + # remove tests with external dependencies that may not be available, and + # tests that don't work in sandbox + rm tests/unit/{test_{zypp_plugins,module_names},utils/test_extend}.py || die + rm tests/unit/modules/test_{file,boto_{vpc,secgroup,elb}}.py || die + rm tests/unit/states/test_boto_vpc.py || die + rm tests/support/gitfs.py tests/unit/runners/test_git_pillar.py || die + rm tests/pytests/functional/transport/server/test_req_channel.py || die + + # tests that require network access + rm tests/unit/{states,modules}/test_zcbuildout.py || die + rm -r tests/integration/cloud || die + rm -r tests/kitchen/tests/wordpress/tests || die + rm tests/kitchen/test_kitchen.py || die + rm tests/unit/modules/test_network.py || die + rm tests/pytests/functional/modules/test_pip.py || die + rm tests/pytests/unit/client/ssh/test_ssh.py || die + + # tests require root access + rm tests/integration/pillar/test_git_pillar.py || die + rm tests/integration/states/test_supervisord.py || die + + # make sure pkg_resources doesn't bomb because pycrypto isn't installed + find "${S}" -name '*.txt' -print0 | xargs -0 sed -e '/pycrypto>/ d ; /pycryptodomex/ d' -i || die + # pycryptodome rather than pycryptodomex + find "${S}" -name '*.py' -print0 | xargs -0 -- sed -i -e 's:Cryptodome:Crypto:g' -- || die + + distutils-r1_python_prepare_all +} + +python_prepare() { + einfo "Fixing collections.abc warnings for ${EPYTHON}" + local abc + abc="$("${EPYTHON}" -c 'import collections.abc; print("|".join((c for c in dir(collections.abc) if not c.startswith("_"))))')" || die + find -name '*.py' -type f -print0 | xargs -0 sed -r -e "s:collections\\.(${abc}):collections.abc.\\1:g" -i || die + + # removes contextvars, see bug: https://bugs.gentoo.org/799431 + sed -i '/^contextvars/d' requirements/base.txt || die +} + +python_install_all() { + local svc + USE_SETUPTOOLS=1 distutils-r1_python_install_all + + for svc in minion master syndic api; do + newinitd "${FILESDIR}"/${svc}-initd-5 salt-${svc} + newconfd "${FILESDIR}"/${svc}-confd-1 salt-${svc} + systemd_dounit "${FILESDIR}"/salt-${svc}.service + done + + insinto /etc/${PN} + doins -r conf/* +} + +python_test() { + # testsuite likes lots of files + ulimit -n 4096 || die + + # ${T} is too long a path for the tests to work + local TMPDIR + TMPDIR="$(mktemp --directory --tmpdir=/tmp ${PN}-XXXX)" + ( + export TMPDIR + cleanup() { rm -rf "${TMPDIR}" || die; } + + trap cleanup EXIT + + addwrite "${TMPDIR}" + + USE_SETUPTOOLS=1 NO_INTERNET=1 SHELL="/bin/bash" \ + "${EPYTHON}" -m pytest -vv \ + || die "testing failed with ${EPYTHON}" + ) +} + +pkg_postinst() { + if use python_targets_python3_8; then + if use nova; then + ewarn "Salt's nova functionality will not work with python3.8 since" + ewarn "dev-python/python-novaclient does not support it yet" + fi + if use neutron; then + ewarn "Salt's neutron functionality will not work with python3.8 since" + ewarn "dev-python/python-neutronclient does not support it yet" + fi + if use libvirt; then + ewarn "Salt's libvirt functionality will not work with python3.8 since" + ewarn "dev-python/libvirt-python does not support it yet" + fi + fi +} -- cgit v1.2.3