From c2a15234e992a5a4445f71b60c61c277ecc65b56 Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 25 Jul 2024 17:36:11 +0000 Subject: [PATCH] testing/castero: rebuild against python 3.12, switch to gpep517 --- testing/castero/APKBUILD | 20 ++++++++++++-------- testing/castero/fix-display-tests.patch | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 testing/castero/fix-display-tests.patch diff --git a/testing/castero/APKBUILD b/testing/castero/APKBUILD index 1695f40a4a2..fbec4d1702d 100644 --- a/testing/castero/APKBUILD +++ b/testing/castero/APKBUILD @@ -2,11 +2,10 @@ # Maintainer: Dmitry Zakharchenko pkgname=castero pkgver=0.9.5 -pkgrel=2 +pkgrel=3 pkgdesc="TUI podcast client for the terminal" url="https://github.com/xgi/castero" -# loongarch64: tests fail -arch="noarch !loongarch64" +arch="noarch" license="MIT" depends=" py3-beautifulsoup4 @@ -18,10 +17,12 @@ depends=" py3-tz python3 " -makedepends="py3-setuptools" +makedepends="py3-gpep517 py3-setuptools py3-wheel" checkdepends="py3-pytest" subpackages="$pkgname-pyc" -source="$pkgname-$pkgver.tar.gz::https://github.com/xgi/castero/archive/v$pkgver.tar.gz" +source="$pkgname-$pkgver.tar.gz::https://github.com/xgi/castero/archive/v$pkgver.tar.gz + fix-display-tests.patch + " prepare() { default_prepare @@ -30,17 +31,20 @@ prepare() { } build() { - python3 setup.py build + gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2 } check() { - pytest -k 'not test_player_vlcplayer' + python3 -m venv --clear --without-pip --system-site-packages .testenv + .testenv/bin/python3 -m installer .dist/*.whl + .testenv/bin/python3 -m pytest -k 'not test_player_vlcplayer' } package() { - python3 setup.py install --skip-build --root="$pkgdir" + python3 -m installer -d "$pkgdir" .dist/*.whl } sha512sums=" 3bd962f8a609dbd37cd133902f1cf8d619749179aeb790339a52849e4222c95b35d396a8b20e8690b412616cb2699fcba3d3ecfc87360579eaa08dfdddc9db30 castero-0.9.5.tar.gz +ccf2d58cf6c700feab8ef68a4c811f7df9489ddbdddc6188b1b7a57c6f247ca9442e813e577a7a252d8ab61a8b60b042338802972118af00ad4343134a45d5a2 fix-display-tests.patch " diff --git a/testing/castero/fix-display-tests.patch b/testing/castero/fix-display-tests.patch new file mode 100644 index 00000000000..47b8bdf7f7a --- /dev/null +++ b/testing/castero/fix-display-tests.patch @@ -0,0 +1,20 @@ +--- castero-0.9.5-origin/tests/test_display.py ++++ castero-0.9.5/tests/test_display.py +@@ -58,7 +58,7 @@ + assert display._footer_window.clear.call_count == 1 + assert display._footer_window.addstr.call_count == 2 + display._footer_window.addstr.assert_any_call(1, 0, "prompt") +- assert display._footer_window.called_with(1, len("prompt")) ++ display._footer_window.addstr.assert_called_with(1, 0, "prompt") + + + def test_display_get_y_n(display): +@@ -66,7 +66,7 @@ + assert display._footer_window.clear.call_count == 1 + assert display._footer_window.addstr.call_count == 2 + display._footer_window.addstr.assert_any_call(1, 0, "prompt") +- assert display._footer_window.called_with(1, len("prompt")) ++ display._footer_window.addstr.assert_called_with(1, 0, "prompt") + + + def test_display_input_keys(display):