summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authora8212024-03-27 21:00:08 +0100
committera8212024-03-27 21:00:08 +0100
commit8c0e20e5c803f1535b05585714eb330d2066e784 (patch)
treea7e742e8c0fd0b50d7260a9f717cb32e9b2af4b7 /PKGBUILD
parent1577b0d0d6e3776567cf052795b14d6b87275181 (diff)
downloadaur-python-pysma.tar.gz
fix: follow python packaging guidelines
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD30
1 files changed, 21 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 8a0e48d7ea11..685f1a54eed1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,20 +1,32 @@
+# Maintainer:
+# Contributor: a821 at mail de
+# Contributor: AlD
+
pkgname=python-pysma
pkgver=0.7.5
-_pypiname=${pkgname#python-}
-pkgrel=1
+pkgrel=2
pkgdesc="Async library for SMA Solar's WebConnect interface"
arch=(any)
url="https://github.com/kellerza/pysma"
-license=(Apache-2.0)
-makedepends=("python" "python-pip")
-depends=("python-jmespath")
+license=('MIT')
+depends=('python-jmespath' 'python-aiohttp' 'python-attrs')
+makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel')
+checkdepends=('python-pytest-aiohttp' 'python-aioresponses' 'python-pytest-asyncio')
+source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
+sha256sums=('ae2ec7d1c36e513142a51eab801ddc1319762e1aef6ebc31035c58d8a9d03edb')
build() {
- pip install --no-deps --target="${_pypiname}" ${_pypiname}==${pkgver}
+ cd pysma-$pkgver
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd pysma-$pkgver
+ pytest
}
package() {
- sitepackages=$(python -c "import site; print(site.getsitepackages()[0])")
- mkdir -p $pkgdir/"$sitepackages"
- cp -r $srcdir/${_pypiname}/* $pkgdir/"$sitepackages"
+ cd pysma-$pkgver
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}