diff options
author | a821 | 2024-03-27 21:00:08 +0100 |
---|---|---|
committer | a821 | 2024-03-27 21:00:08 +0100 |
commit | 8c0e20e5c803f1535b05585714eb330d2066e784 (patch) | |
tree | a7e742e8c0fd0b50d7260a9f717cb32e9b2af4b7 /PKGBUILD | |
parent | 1577b0d0d6e3776567cf052795b14d6b87275181 (diff) | |
download | aur-python-pysma.tar.gz |
fix: follow python packaging guidelines
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -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 } |