diff --git a/python3-pendulum/alr.sh b/python3-pendulum/alr.sh new file mode 100644 index 0000000..4422f8c --- /dev/null +++ b/python3-pendulum/alr.sh @@ -0,0 +1,67 @@ +_name=pendulum +name='python3-pendulum' +version='3.0.0' +release='1' +desc='Python datetimes made easy' +homepage='https://pendulum.eustace.io/' +license=('MIT') +architectures=('amd64') +provides=('pendulum') +conflicts=('pendulum') + +deps=( + 'libgcc' + 'glibc' + 'python' + 'python3-dateutil' + 'python3-tzdata' + 'python3-time-machine' +) + +build_deps=( + 'python3-build' + 'python3-installer' + 'python3-maturin' + 'python3-wheel' +) + +build_deps_almalinux=( + 'python3-build' + 'python3-installer' + 'python3-maturin' + 'python3.12-wheel' + 'python3-babel' + 'python3-freezegun' + 'python3-pytest' + 'python3-pytz' + 'python3-pytzdata' + +) + +sources=("https://github.com/sdispater/pendulum/archive/$version.tar.gz") +checksums=('SKIP') + +build() { + cd $_name-$version + python -m build --wheel --no-isolation +} + +check() { + local pytest_options=( + -vv + ) + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + + cd $_name-$version + # install to temporary location, as importlib is used + python -m installer --destdir=test_dir dist/*.whl + export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH" + pytest "${pytest_options[@]}" +} + +package() { + cd $_name-$version + python -m installer --destdir="$pkgdir" dist/*.whl + install -vDm 644 {CHANGELOG.md,README.rst} -t "$pkgdir/usr/share/doc/$pkgname/" + install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" +}