From a1e006e6469a360529f3d6875fe8f3c465c71718 Mon Sep 17 00:00:00 2001 From: Sam James <sam@gentoo.org> Date: Fri, 26 Nov 2021 01:23:37 +0000 Subject: dev-python/pytest-salt-factories: needs salt at runtime Caused a test failure in traitlets: ``` File "/usr/lib/python3.8/site-packages/saltfactories/utils/__init__.py", line 15, in <module> import salt.utils.user ModuleNotFoundError: No module named 'salt' * ERROR: dev-python/traitlets-5.1.1::gentoo failed (test phase): * pytest failed with python3.8 ``` Signed-off-by: Sam James <sam@gentoo.org> --- .../pytest-salt-factories-0.121.1-r1.ebuild | 63 +++++++++++++++++++++ .../pytest-salt-factories-0.121.1.ebuild | 64 ---------------------- 2 files changed, 63 insertions(+), 64 deletions(-) create mode 100644 dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1-r1.ebuild delete mode 100644 dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild (limited to 'dev-python/pytest-salt-factories') diff --git a/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1-r1.ebuild b/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1-r1.ebuild new file mode 100644 index 000000000000..e4d2f0f1ee31 --- /dev/null +++ b/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 2020-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +inherit distutils-r1 + +DESCRIPTION="The new generation of the pytest-salt Plugin" +HOMEPAGE="https://github.com/saltstack/pytest-salt-factories" +SRC_URI="https://github.com/saltstack/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 x86" +IUSE="test" + +RDEPEND=" + >=dev-python/pytest-6.1.1[${PYTHON_USEDEP}] + dev-python/attrs[${PYTHON_USEDEP}] + dev-python/pytest-tempdir[${PYTHON_USEDEP}] + dev-python/psutil[${PYTHON_USEDEP}] + dev-python/pyzmq[${PYTHON_USEDEP}] + dev-python/msgpack[${PYTHON_USEDEP}] + >=app-admin/salt-3001.0[${PYTHON_USEDEP}] +" +BDEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}/pytest-salt-factories-0.121.1-tests.patch" +) + +distutils_enable_tests --install pytest + +python_prepare_all() { + sed -r -e "s:use_scm_version=True:version='${PV}', name='${PN//-/.}':" -i setup.py || die + sed -r -e '/(setuptools|setup_requires)/ d' -i setup.cfg || die + + sed -i 's:tool.setuptools_scm:tool.disabled:' pyproject.toml || die + printf '__version__ = "%s"\n' "${PV}" > saltfactories/version.py || die + distutils-r1_python_prepare_all +} + +python_test() { + local tempdir + + # ${T} is too long a path for the tests to work + tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)" + mkdir "${T}/$(basename "${tempdir}")" + + addwrite "${tempdir}" + ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die + + distutils_install_for_testing --via-root + + ( + cleanup() { rm -f "${tempdir}" || die; } + + trap cleanup EXIT + SHELL="/bin/bash" TMPDIR="${tempdir}" \ + pytest -vv || die "Tests failed with ${EPYTHON}" + ) +} diff --git a/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild b/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild deleted file mode 100644 index 9ffba74e4847..000000000000 --- a/dev-python/pytest-salt-factories/pytest-salt-factories-0.121.1.ebuild +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2020-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..9} ) -inherit distutils-r1 - -DESCRIPTION="The new generation of the pytest-salt Plugin" -HOMEPAGE="https://github.com/saltstack/pytest-salt-factories" -SRC_URI="https://github.com/saltstack/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 ~arm ~arm64 x86" -IUSE="test" - -RDEPEND=" - >=dev-python/pytest-6.1.1[${PYTHON_USEDEP}] - dev-python/attrs[${PYTHON_USEDEP}] - dev-python/pytest-tempdir[${PYTHON_USEDEP}] - dev-python/psutil[${PYTHON_USEDEP}] - dev-python/pyzmq[${PYTHON_USEDEP}] - dev-python/msgpack[${PYTHON_USEDEP}] -" -BDEPEND="${RDEPEND} - test? ( >=app-admin/salt-3001.0[${PYTHON_USEDEP}] ) -" - -PATCHES=( - "${FILESDIR}/pytest-salt-factories-0.121.1-tests.patch" -) - -distutils_enable_tests --install pytest - -python_prepare_all() { - sed -r -e "s:use_scm_version=True:version='${PV}', name='${PN//-/.}':" -i setup.py || die - sed -r -e '/(setuptools|setup_requires)/ d' -i setup.cfg || die - - sed -i 's:tool.setuptools_scm:tool.disabled:' pyproject.toml || die - printf '__version__ = "%s"\n' "${PV}" > saltfactories/version.py || die - distutils-r1_python_prepare_all -} - -python_test() { - local tempdir - - # ${T} is too long a path for the tests to work - tempdir="$(mktemp -du --tmpdir=/tmp salt-XXX)" - mkdir "${T}/$(basename "${tempdir}")" - - addwrite "${tempdir}" - ln -s "$(realpath --relative-to=/tmp "${T}/$(basename "${tempdir}")")" "${tempdir}" || die - - distutils_install_for_testing --via-root - - ( - cleanup() { rm -f "${tempdir}" || die; } - - trap cleanup EXIT - SHELL="/bin/bash" TMPDIR="${tempdir}" \ - pytest -vv || die "Tests failed with ${EPYTHON}" - ) -} -- cgit v1.2.3-65-gdbad