40 lines
1.5 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgname=python-validate-pyproject
pkgver=0.22
pkgrel=2
pkgdesc="Validation library and CLI tool for checking on 'pyproject.toml' files using JSON Schema"
url="https://github.com/abravalheri/validate-pyproject"
license=('MPL')
arch=(any)
depends=('python-fastjsonschema' 'python-packaging' 'python-trove-classifiers')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools-scm')
checkdepends=('python-pytest')
source=("git+https://github.com/abravalheri/validate-pyproject.git#tag=v$pkgver")
sha512sums=('47ad0fe1f741a2f23e3b4ab64fce89950fb090ce001cc7bd71431b9f085a9b3e6064b0449f7ac25f3fdf9719cdd427781afae8a9414e03d4c136c7f5662b88a7')
prepare() {
cd validate-pyproject
}
build() {
cd validate-pyproject
python -m build -wn
}
check() {
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
cd validate-pyproject
python -m installer --destdir=tmp_install dist/*.whl
PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH" pytest -o addopts='' --doctest-modules --ignore src/validate_pyproject/_vendor src
# Deselected tests requiring a installed validate-pyproject
PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH" pytest -o addopts='' --deselect tests/test_pre_compile.py --deselect tests/test_vendoring.py
}
package() {
cd validate-pyproject
python -m installer --destdir="$pkgdir" dist/*.whl
}