# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-jsonschema-path
# https://github.com/p1c2u/jsonschema-path/releases
pkgver=0.3.3
pkgrel=2
pkgdesc="JSONSchema Spec with object-oriented paths"
url="https://github.com/p1c2u/jsonschema-path"
# https://github.com/p1c2u/jsonschema-path/blob/0.3.3/pyproject.toml#L25
license=('Apache-2.0')
arch=('any')
depends=('python' 'python-pathable' 'python-yaml' 'python-requests' 'python-referencing')
makedepends=('python-build' 'python-installer' 'python-poetry-core')
checkdepends=('python-pytest' 'python-responses')
source=("https://github.com/p1c2u/jsonschema-path/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('846d476285b4c89d0241d18be09eb7c12df855f7b28f0d3ea9942a9d23977f3c051b93a1281f6f5323c2c4bc9c86fe82b5eae1bce647f58d9d2acce65d4f54a8')

prepare() {
  cd jsonschema-path-$pkgver
  sed -i '/--cov/d' pyproject.toml
}

build() {
  cd jsonschema-path-$pkgver
  python -m build -wn
}

check() {
  cd jsonschema-path-$pkgver
  PYTHONPATH="$PWD" pytest
}

package() {
  cd jsonschema-path-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
}
