# Maintainer: Felix Yan # Contributor: codedust # Contributor: Dario Ostuni # Contributor: Clayton Craft pkgname=python-setuptools-rust pkgver=1.5.2 pkgrel=3 pkgdesc="Compile and distribute Python extensions written in rust as easily as if they were written in C." arch=('any') license=('MIT') url="https://github.com/PyO3/setuptools-rust" depends=('rust' 'python-setuptools' 'python-semantic-version' 'python-typing-extensions') checkdepends=('python-pytest' 'python-pytest-benchmark' 'python-beautifulsoup4' 'python-lxml' 'python-cffi') source=("https://github.com/PyO3/setuptools-rust/archive/v$pkgver/$pkgname-$pkgver.tar.gz") sha512sums=('e80d1296fd09c24b644d821e981261153ff19ae62d978fc8ee81c78e440d215f9d1e91e33d758effb94fcb64985937445940f2e2f032ad1b8c2aa39be79cf19d') build() { cd setuptools-rust-$pkgver python setup.py build } check() { cd setuptools-rust-$pkgver python setup.py egg_info for _dir in examples/*; do pushd $_dir PYTHONPATH="$PWD/../.." python setup.py build [[ -d tests || -d test ]] && PYTHONPATH="$PWD/build/lib:build/lib.linux-$CARCH-cpython-311" pytest popd done pytest --doctest-modules setuptools_rust } package() { cd setuptools-rust-$pkgver python setup.py install --root="$pkgdir" --optimize=1 install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/ }