blob: 4c9b092ab47b813e60811277ab5ea523e854e78a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# Maintainer: Carl Smedstad <carsme@archlinux.org>
pkgname=deptry
pkgver=0.21.2
pkgrel=1
pkgdesc="Find unused, missing and transitive dependencies in a Python project"
arch=(x86_64)
url="https://github.com/fpgmaas/deptry"
license=(MIT)
depends=(
gcc-libs
glibc
python
python-click
python-packaging
python-requirements-parser
)
makedepends=(
git
python-build
python-installer
python-maturin
python-wheel
)
checkdepends=(
python-pytest
python-pytest-xdist
)
source=("$pkgname::git+$url.git#tag=$pkgver")
sha256sums=('d9ada26276355a6eca8349e8b654a387153a207730a3a41b45258b4045f1ca26')
prepare() {
cd $pkgname
sed -i "s|^version = \".*\"|version = \"$pkgver\"|" pyproject.toml
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd $pkgname
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
python -m build --wheel --no-isolation
}
check() {
cd $pkgname
rm -rf tmp_install
python -m installer --destdir=tmp_install dist/*.whl
# The functional tests expect the wheel to be here.
mkdir -p build/functional_tests/deptry
cp dist/*.whl build/functional_tests/deptry
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
export PYTHONPATH="$PWD/tmp_install/$site_packages"
# Deselect test failing with AssertionError, only in a chroot - not sure why.
pytest tests/
}
package() {
cd $pkgname
python -m installer --destdir="$pkgdir" dist/*.whl
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
|