From d00b7757cb52b8bc7f0be4b711a195e52b1b7092 Mon Sep 17 00:00:00 2001
From: ptrcnull <git@ptrcnull.me>
Date: Sat, 31 Aug 2024 16:24:44 +0200
Subject: [PATCH] testing/thefuck: build with gpep517, enable tests

---
 testing/thefuck/APKBUILD | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/testing/thefuck/APKBUILD b/testing/thefuck/APKBUILD
index f3b08473a2c2..50449451fee6 100644
--- a/testing/thefuck/APKBUILD
+++ b/testing/thefuck/APKBUILD
@@ -2,28 +2,35 @@
 # Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
 pkgname=thefuck
 pkgver=3.32
-pkgrel=4
+pkgrel=5
 pkgdesc="The Fuck is a magnificent app that corrects errors in previous console commands."
 url="https://github.com/nvbn/thefuck"
 arch="noarch"
 license="MIT"
 depends="py3-colorama py3-six py3-decorator py3-psutil py3-pyte"
-makedepends="py3-setuptools"
+makedepends="py3-setuptools py3-gpep517"
+checkdepends="py3-pytest py3-pytest-mock"
 subpackages="$pkgname-pyc"
 source="thefuck-$pkgver.tar.gz::https://github.com/nvbn/thefuck/archive/$pkgver.tar.gz
 0420442e778dd7bc53bdbdb50278eea2c207dc74.patch
 "
 
-check() {
-	python3 setup.py check
+build() {
+	gpep517 build-wheel \
+		--wheel-dir .dist \
+		--output-fd 3 3>&1 >&2
 }
 
-build() {
-	python3 setup.py build
+check() {
+	python3 -m venv --clear --without-pip --system-site-packages .testenv
+	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
+	.testenv/bin/python3 -m pytest \
+		--deselect tests/test_utils.py::TestGetValidHistoryWithoutCurrent
 }
 
 package() {
-	python3 setup.py install --skip-build --root="$pkgdir"
+	gpep517 install-wheel --destdir "$pkgdir" \
+		.dist/*.whl
 }
 
 sha512sums="
-- 
GitLab