diff options
Diffstat (limited to 'dev-python/unittest-or-fail')
-rw-r--r-- | dev-python/unittest-or-fail/Manifest | 2 | ||||
-rw-r--r-- | dev-python/unittest-or-fail/unittest-or-fail-2-r1.ebuild | 45 | ||||
-rw-r--r-- | dev-python/unittest-or-fail/unittest-or-fail-2.ebuild | 34 |
3 files changed, 46 insertions, 35 deletions
diff --git a/dev-python/unittest-or-fail/Manifest b/dev-python/unittest-or-fail/Manifest index 3f8daca2ab84..76bfc9d0f7cc 100644 --- a/dev-python/unittest-or-fail/Manifest +++ b/dev-python/unittest-or-fail/Manifest @@ -1,3 +1,3 @@ DIST unittest-or-fail-2.tar.gz 3177 BLAKE2B 862a406f3faea7bdf47b8e3f9dfa0057cb45669d9ed47f94dd51b2db107be62d1a332e7e6f0fc8f8f1f6719db90a9ebe19a8379d12a3f0908b073f1dd1dc4643 SHA512 f5b34ed5f312618e174147d1717142fe817fca3f993606f572a6e3f7481f055f793c3b4bc56481e259513ca7ac1b94b8a27ac6e319ccf909f55492edd5f14951 -EBUILD unittest-or-fail-2.ebuild 1114 BLAKE2B 26d2f1eb8781bf9202c896824b67a581ae613179b382050a214fd5dec517c1b7921f23de4572b9543cfbc12793ea27a5ed6aa92d724bb03f92b53e47289a90ec SHA512 2467d1231b7cc57d40f2f6d5dae17a13fc63331bb1960b53b36888d4c24bef8a276917add2fd60e4f77d3e47faa61b8e7609a91ec41f840349d9e50b96c5b61a +EBUILD unittest-or-fail-2-r1.ebuild 1292 BLAKE2B 0eaf6e9e86b705aa0b67751104709f4795297493f5e732b3a6bb101faeaef3cfd293b5c41eca5f71ca1ff392dda4e126423768763469f72b0459f2c5be19bc95 SHA512 eb4e3450da5e51016c1bec5a45b52b4cb7822a8563fed99a878826bacef0ea2cb5fd3736c4dc58b145b26dc5c8303ae98e7ca8e2d3e06321ec05aba18a482240 MISC metadata.xml 461 BLAKE2B 6a4325c0796ea5bf40f5bf6d834abef3cffba6e11c98b3748132c07a76b2ce590d56d21a0fe20ec99395ec6fbf573a2bd3eb62d2cd7e9962a5b28b9bb8063aa2 SHA512 ee5c3d4f2beebafd5ad16c3444bd653ddcbdac8c6429977a3468c2f6194d051b3f93330582d1a2b302c356bd93c4ce70d15873f568d32731546d263ce4b619b5 diff --git a/dev-python/unittest-or-fail/unittest-or-fail-2-r1.ebuild b/dev-python/unittest-or-fail/unittest-or-fail-2-r1.ebuild new file mode 100644 index 000000000000..79c06c9a6b9b --- /dev/null +++ b/dev-python/unittest-or-fail/unittest-or-fail-2-r1.ebuild @@ -0,0 +1,45 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +# in py3.12+ unittest already fails when no tests are found +# we're adding these impls to PYTHON_COMPAT to clean up upgrade graphs +# but we're not installing anything +PYTHON_USED=( pypy3 python3_{10..11} ) +PYTHON_COMPAT=( "${PYTHON_USED[@]}" python3_{12..13} ) + +inherit distutils-r1 + +DESCRIPTION="Run unittests or fail if no tests were found" +HOMEPAGE="https://github.com/projg2/unittest-or-fail/" +SRC_URI=" + https://github.com/projg2/unittest-or-fail/archive/v${PV}.tar.gz + -> ${P}.tar.gz +" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" + +python_compile() { + if has "${EPYTHON/./_}" "${PYTHON_USED[@]}"; then + distutils-r1_python_compile + fi +} + +# Warning: do not use distutils_enable_tests to avoid a circular +# dependency on itself! +python_test() { + if has "${EPYTHON/./_}" "${PYTHON_USED[@]}"; then + "${EPYTHON}" -m unittest -v test/test_unittest_or_fail.py || + die "Tests failed with ${EPYTHON}" + fi +} + +python_install() { + if has "${EPYTHON/./_}" "${PYTHON_USED[@]}"; then + distutils-r1_python_install + fi +} diff --git a/dev-python/unittest-or-fail/unittest-or-fail-2.ebuild b/dev-python/unittest-or-fail/unittest-or-fail-2.ebuild deleted file mode 100644 index e71959e95147..000000000000 --- a/dev-python/unittest-or-fail/unittest-or-fail-2.ebuild +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2021-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=flit -PYTHON_COMPAT=( python3_{10..12} pypy3 ) - -inherit distutils-r1 - -DESCRIPTION="Run unittests or fail if no tests were found" -HOMEPAGE="https://github.com/projg2/unittest-or-fail/" -SRC_URI=" - https://github.com/projg2/unittest-or-fail/archive/v${PV}.tar.gz - -> ${P}.tar.gz -" - -LICENSE="BSD-2" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" - -# Warning: do not use distutils_enable_tests to avoid a circular -# dependency on itself! -python_test() { - # unittest fails in python3.12 by default, and it is more strict - # than the behavior expected from unittest-or-fail. We only add - # 3.12 compat to workaround a pkgcheck limitation, so no point - # in fixing the tests. - # https://github.com/pkgcore/pkgcheck/issues/584 - [[ ${EPYTHON} == python3.12 ]] && return - - "${EPYTHON}" -m unittest -v test/test_unittest_or_fail.py || - die "Tests failed with ${EPYTHON}" -} |