aports/community/py3-watchfiles/APKBUILD
psykose 7853d213cc */*: remove CARGO_REGISTRIES_CRATES_IO_PROTOCOL
we now set this in abuild instead.
2023-05-06 04:28:28 +02:00

49 lines
1.6 KiB
Plaintext

# Contributor: Newbyte <newbyte@disroot.org>
# Maintainer: JuniorJPDJ <alpine@juniorjpdj.pl>
pkgname=py3-watchfiles
pkgver=0.18.1
pkgrel=3
pkgdesc="Simple, modern file watching and code reload in Python"
url="https://github.com/samuelcolvin/watchfiles"
arch="all !armhf !ppc64le" # limited by py3-anyio
license="MIT"
depends="python3 py3-anyio"
makedepends="cargo maturin py3-installer py3-wheel"
checkdepends="py3-pytest py3-pytest-asyncio py3-pytest-mock py3-pytest-toolbox py3-pytest-timeout py3-dirty-equals"
subpackages="$pkgname-pyc"
source="$pkgname-v$pkgver.tar.gz::https://github.com/samuelcolvin/watchfiles/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/watchfiles-$pkgver"
prepare() {
default_prepare
VERSION="$pkgver" .github/set_version.py
sed -i 's/version = "0.0.0"/version = "'"$pkgver"'"/g' Cargo.lock
}
build() {
maturin build --release --manylinux off --locked --all-features --target "$CTARGET"
}
check() {
local python_path="$(python3 -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())')"
mkdir -vp testdir
export PYTHONPATH="testdir$python_path:$PYTHONPATH"
python3 -m installer -d testdir target/wheels/watchfiles-*.whl
# Fails on slow systems or when system is under heavy load.
# See upstream issue #84
pytest -k 'not test_awatch_log'
}
package() {
install -Dm755 "target/$CTARGET/release/lib_rust_notify.so" -t "$pkgdir/usr/lib"
python3 -m installer -d "$pkgdir" target/wheels/watchfiles-*.whl
}
sha512sums="
6d2b164475357d98b3531dfa18e50c86120b5339f17786a9b99ed97cb4dfb87c6a4183c5978fc2044a987ffaeeb4218ba46fe25b24a6e3e661a11e39c9eb211f py3-watchfiles-v0.18.1.tar.gz
"