summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorKlaus Alexander Seistrup2024-04-28 10:43:24 +0200
committerKlaus Alexander Seistrup2024-04-28 10:43:24 +0200
commit774c9523aea8bd5b8b4105f4a53b3fe4a8c538af (patch)
tree08c5fa7d1469adb6c46036e4a2283880b64c51e8 /PKGBUILD
parentd73e4f7d5d49699ad683a07a994c6f58de08e802 (diff)
downloadaur-774c9523aea8bd5b8b4105f4a53b3fe4a8c538af.tar.gz
Bump for Python 3.12
Also: * attempt to use Niquests in lieu of Requests * increase verbosity for install command
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD22
1 files changed, 15 insertions, 7 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 99b0541e8877..86d0af793646 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,8 +3,9 @@
pkgname='python-metno-locationforecast'
_pkgname="${pkgname#python-}"
+epoch=1
pkgver=1.1.0
-pkgrel=4
+pkgrel=1
pkgdesc='Python interface for the MET Norway Locationforecast/2.0 weather service'
arch=('any')
license=('MIT') # SPDX-License-Identifier: MIT
@@ -17,6 +18,9 @@ depends=(
'python'
'python-requests'
)
+optdepends=(
+ 'python-niquests: a moderne drop-in replacement for python-requests'
+)
makedepends=(
'python-build'
'python-installer'
@@ -32,26 +36,30 @@ b2sums=(
)
prepare() {
- cd "$_pkgname-$pkgver" || exit 1
+ cd "$_pkgname-$pkgver"
patch -Np1 -i "$srcdir/setup-py.diff"
+
+ # https://github.com/Rory-Sullivan/metno-locationforecast/issues/6
+ _try_niquests='try:\n import niquests as requests\nexcept ImportError:\n import requests'
+ sed -i "s/import requests/$_try_niquests/g" "${_pkgname/-/_}/forecast.py"
}
build() {
- cd "$srcdir/$_pkgname-$pkgver" || exit 1
+ cd "$srcdir/$_pkgname-$pkgver"
python -m build --wheel --no-isolation
}
package() {
- cd "$srcdir/$_pkgname-$pkgver" || exit 1
+ cd "$srcdir/$_pkgname-$pkgver"
python -m installer --destdir="$pkgdir" dist/*.whl
- install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ install -vDm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
- for mdfile in CHANGELOG.md README.md; do
- install -Dm0644 "$mdfile" "$pkgdir/usr/share/doc/$pkgname/$mdfile"
+ for _doc in CHANGELOG.md README.md; do
+ install -vDm0644 "$_doc" "$pkgdir/usr/share/doc/$pkgname/$_doc"
done
}