From 3bb1b980e64bcbafa8d7cee8d68097d3f9d8fd4e Mon Sep 17 00:00:00 2001
From: Iztok Fister Jr <iztok@iztok-jr-fister.eu>
Date: Mon, 6 Jun 2022 13:16:33 +0000
Subject: [PATCH] testing/py3-fireflyalgorithm: upgrade to 0.3.1

---
 testing/py3-fireflyalgorithm/APKBUILD         | 19 ++++++++++--------
 .../rename-project-name.patch                 | 20 +++++++++++++++++++
 2 files changed, 31 insertions(+), 8 deletions(-)
 create mode 100644 testing/py3-fireflyalgorithm/rename-project-name.patch

diff --git a/testing/py3-fireflyalgorithm/APKBUILD b/testing/py3-fireflyalgorithm/APKBUILD
index a08b5c61b0c2..661d07bccbee 100644
--- a/testing/py3-fireflyalgorithm/APKBUILD
+++ b/testing/py3-fireflyalgorithm/APKBUILD
@@ -2,30 +2,33 @@
 # Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
 pkgname=py3-fireflyalgorithm
 _pkgorig=FireflyAlgorithm
-pkgver=0.3
+pkgver=0.3.1
 pkgrel=0
 pkgdesc="Implementation of Firefly Algorithm for optimization in Python"
 url="https://github.com/firefly-cpp/FireflyAlgorithm"
 arch="noarch"
 license="MIT"
 depends="python3 py3-numpy"
-makedepends="py3-setuptools"
+makedepends="py3-build py3-poetry-core py3-wheel py3-installer"
 checkdepends="py3-pytest"
-source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/f/fireflyalgorithm/FireflyAlgorithm-$pkgver.tar.gz"
-builddir="$srcdir/$_pkgorig-$pkgver"
+source="https://github.com/firefly-cpp/FireflyAlgorithm/archive/$pkgver/$_pkgorig-$pkgver.tar.gz
+	rename-project-name.patch"
+builddir="$srcdir/FireflyAlgorithm-$pkgver"
 
 build() {
-	python3 setup.py build
+	GIT_DIR="$builddir" python3 -m build --no-isolation --wheel
 }
 
 check() {
-	pytest
+	python3 -m pytest
 }
 
 package() {
-	python3 setup.py install --prefix=/usr --root="$pkgdir"
+	python3 -m installer -d "$pkgdir" \
+		dist/fireflyalgorithm-$pkgver-py3-none-any.whl
 }
 
 sha512sums="
-5485c28a39f70b5bba3450f5ad418a2bb91f777183fa7e6ec131820397592192567fe691858b1dce7fb7228939ee2b1c86ec1a247cbbbf4a3ac29754703fdb9c  py3-fireflyalgorithm-0.3.tar.gz
+c205c356a854ef10a48ced8dd99d0425ad025df1e9980057761ec12dcd88d135190e6448286c9fb913040cfa9621e27e54a110822787c3e78cae5083e10023aa  FireflyAlgorithm-0.3.1.tar.gz
+a837a474e0b59dcfd1debea2bf36a12b97db2e711b7f08c81e0602b2f7d3398f0171c550fb37758e4bf7bca9d169fde42c8043da8b0b12b409fb19a578860c6c  rename-project-name.patch
 "
diff --git a/testing/py3-fireflyalgorithm/rename-project-name.patch b/testing/py3-fireflyalgorithm/rename-project-name.patch
new file mode 100644
index 000000000000..a4e3d69fb976
--- /dev/null
+++ b/testing/py3-fireflyalgorithm/rename-project-name.patch
@@ -0,0 +1,20 @@
+From 346dadd9695ef2c6efe1c0c7b3534d149d061b3d Mon Sep 17 00:00:00 2001
+From: firefly-cpp <iztok@iztok-jr-fister.eu>
+Date: Mon, 6 Jun 2022 15:02:09 +0200
+Subject: [PATCH] Rename project name in pyproject.toml
+
+---
+ pyproject.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pyproject.toml b/pyproject.toml
+index a940060..fe3575d 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -1,5 +1,5 @@
+ [tool.poetry]
+-name = "FireflyAlgorithm"
++name = "fireflyalgorithm"
+ version = "0.3.1"
+ description = "Implementation of Firefly Algorithm in Python"
+ authors = ["firefly-cpp"]
-- 
GitLab