summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 99c9000ed8047c1443431217d20d952e9a4c3909 (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
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>

pkgname=python-lagom
_pkg="${pkgname#python-}"
pkgver=2.7.7
pkgrel=1
pkgdesc="Autowiring dependency injection container"
arch=('any')
url="https://github.com/meadsteve/lagom"
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-installer' 'mypy' 'python-setuptools' 'python-wheel')
checkdepends=(
	'python-django'
	'python-fastapi'
	'python-flask'
	'python-httpx'
	'python-pydantic'
	'python-pytest'
    'python-pytest-asyncio'
	'python-starlette')
optdepends=('python-pydantic')
changelog=CHANGELOG.md
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('8a9fd4ab9f58150c2673ec92c36b704b6f1bf4180af66dfbc131c4cd53625a72')

prepare() {
	cd "$_pkg-$pkgver"
	sed -i 's/mypy==/mypy>=/' pyproject.toml
}

build() {
	cd "$_pkg-$pkgver"
	export PYTHONPATH="$PWD"
	python -m build --wheel --no-isolation
}

check() {
	cd "$_pkg-$pkgver"
	pytest -x -m 'not benchmarking' --disable-warnings
}

package() {
	cd "$_pkg-$pkgver"
	python -m installer --destdir="$pkgdir/" dist/*.whl
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	ln -s "$_site/$_pkg-$pkgver.dist-info/licenses/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/"
}