summaryrefslogtreecommitdiff
path: root/dev-python/unittest-or-fail
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/unittest-or-fail')
-rw-r--r--dev-python/unittest-or-fail/Manifest1
-rw-r--r--dev-python/unittest-or-fail/unittest-or-fail-2-r1.ebuild45
2 files changed, 46 insertions, 0 deletions
diff --git a/dev-python/unittest-or-fail/Manifest b/dev-python/unittest-or-fail/Manifest
index 3f8daca2ab84..166656137d09 100644
--- a/dev-python/unittest-or-fail/Manifest
+++ b/dev-python/unittest-or-fail/Manifest
@@ -1,3 +1,4 @@
DIST unittest-or-fail-2.tar.gz 3177 BLAKE2B 862a406f3faea7bdf47b8e3f9dfa0057cb45669d9ed47f94dd51b2db107be62d1a332e7e6f0fc8f8f1f6719db90a9ebe19a8379d12a3f0908b073f1dd1dc4643 SHA512 f5b34ed5f312618e174147d1717142fe817fca3f993606f572a6e3f7481f055f793c3b4bc56481e259513ca7ac1b94b8a27ac6e319ccf909f55492edd5f14951
+EBUILD unittest-or-fail-2-r1.ebuild 1300 BLAKE2B 68cd0691e6d4c32eb5dde44258a5deece9646351ffccb7406bd4246d1f63c67a03946716a970814b7310ed6eb052ef5566f2b13c2cb4473c10312f1581b6aa00 SHA512 2740d2e9d4914f55c8796f9f83dd569627f3c9d1c0990e9bbf80604794d068ebeb6644443ddaf0e4c6acf774a89c2b82157490becdc3027747d0607c60603bb8
EBUILD unittest-or-fail-2.ebuild 1114 BLAKE2B 26d2f1eb8781bf9202c896824b67a581ae613179b382050a214fd5dec517c1b7921f23de4572b9543cfbc12793ea27a5ed6aa92d724bb03f92b53e47289a90ec SHA512 2467d1231b7cc57d40f2f6d5dae17a13fc63331bb1960b53b36888d4c24bef8a276917add2fd60e4f77d3e47faa61b8e7609a91ec41f840349d9e50b96c5b61a
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..522d10ee8ad3
--- /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
+}