archrelease: copy trunk to community-any
[ArchLinux/community.git] / check-jsonschema / trunk / PKGBUILD
blob0ea2ef87c2ae1eea472405eb73ff26f90720db60
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgname=check-jsonschema
4 pkgver=0.23.0
5 pkgrel=1
6 pkgdesc="A JSON Schema CLI and pre-commit hook built on jsonschema"
7 arch=(any)
8 url="https://github.com/python-jsonschema/check-jsonschema"
9 license=(Apache)
10 depends=(
11   python
12   python-click
13   python-jsonschema
14   python-requests
15   python-ruamel-yaml
17 makedepends=(
18   python-build
19   python-installer
20   python-setuptools
21   python-wheel
23 checkdepends=(
24   python-pytest
25   python-pytest-xdist
26   python-responses
28 source=(
29   # no tests in sdist tarballs
30   # https://github.com/python-jsonschema/check-jsonschema/issues/258
31   # https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz
32   $url/archive/$pkgver/$pkgname-$pkgver.tar.gz
34 sha512sums=('4ebb3f421396631430b546305a0c589cf553ee06925a8ead865111398f89b7396a0a03fedd535af04237e5de0aa54e9bbd5b384fdba830f1304d47c2474a0d85')
35 b2sums=('7e20a740dc163cc57175b27fc5bbef7d79954da7794a241ed0723f609e5890fe7cd3a501ecc3e6bfa33a446fc26577bdee3ba87e20b91795e45e2109235da08e')
37 check() {
38   # we don't support pinning
39   sed -e 's/==/>=/g' -i $pkgname-$pkgver/setup.cfg
42 build() {
43   cd $pkgname-$pkgver
44   python -m build --wheel --no-isolation
47 check() {
48   local pytest_options=(
49     -vv
50   )
51   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
53   cd $pkgname-$pkgver
54   # install to temporary location, as importlib is used
55   python -m installer --destdir=test_dir dist/*.whl
56   export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
57   pytest "${pytest_options[@]}"
60 package() {
61   cd $pkgname-$pkgver
62   python -m installer --destdir="$pkgdir" dist/*.whl