diff options
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | PKGBUILD | 34 |
2 files changed, 36 insertions, 22 deletions
@@ -1,22 +1,24 @@ pkgbase = python-kornia pkgdesc = Open Source Differentiable Computer Vision Library for PyTorch - pkgver = 0.4.1 + pkgver = 0.7.0 pkgrel = 1 url = https://github.com/kornia/kornia arch = any license = Apache checkdepends = python-pytest - makedepends = python-setuptools + checkdepends = python-pytest-cov + checkdepends = python-pytest-mypy + checkdepends = python-pytest-flake8 + checkdepends = python-scipy + checkdepends = python-opencv + makedepends = python-build + makedepends = python-installer + makedepends = python-wheel + makedepends = python-pytest-runner depends = python-pytorch - depends = python-numpy - depends = python-torchvision - depends = opencv - depends = ipython - depends = jupyter - depends = python-matplotlib + optdepends = python-accelerate: To be able to train options = !emptydirs - source = kornia-0.4.1.tar.gz::https://github.com/kornia/kornia/archive/v0.4.1.tar.gz - sha256sums = 62e785e3c7940eded4c3aeaadf493483b2e064e9c1ec93f347759e64cf25a216 + source = kornia-0.7.0.zip::https://github.com/kornia/kornia/archive/refs/tags/v0.7.0.zip + sha256sums = a0497c29f2612de9b4fe4266ef6a65c98c45ba04c6c90671bb58a1f0d39d5028 pkgname = python-kornia - @@ -1,27 +1,39 @@ # Maintainer: otaj +# If you also want to test GPU portion of the package, set this to 1. Make sure you have a capable GPU with large enough memory +TEST_GPU=0 pkgname=python-kornia _name=kornia -pkgver=0.4.1 +pkgver=0.7.0 pkgrel=1 arch=(any) url='https://github.com/kornia/kornia' pkgdesc='Open Source Differentiable Computer Vision Library for PyTorch' license=(Apache) -makedepends=('python-setuptools') -depends=('python-pytorch' 'python-numpy' 'python-torchvision' 'opencv' 'ipython' 'jupyter' 'python-matplotlib') -checkdepends=('python-pytest') +makedepends=('python-build' 'python-installer' 'python-wheel' 'python-pytest-runner') +depends=('python-pytorch') +optdepends=('python-accelerate: To be able to train') +checkdepends=('python-pytest' 'python-pytest-cov' 'python-pytest-mypy' 'python-pytest-flake8' 'python-scipy' 'python-opencv') options=(!emptydirs) -source=(${_name}-${pkgver}.tar.gz::"${url}/archive/v${pkgver}.tar.gz") -sha256sums=('62e785e3c7940eded4c3aeaadf493483b2e064e9c1ec93f347759e64cf25a216') +# because kornia does not ship `pytest.ini` with their release, we have to get a fat copy of full repo +source=("${_name}-${pkgver}.zip::${url}/archive/refs/tags/v${pkgver}.zip") +sha256sums=('a0497c29f2612de9b4fe4266ef6a65c98c45ba04c6c90671bb58a1f0d39d5028') + +build() { + cd "${srcdir}/${_name}-${pkgver}" + python -m build --wheel --no-isolation +} check() { - cd "${srcdir}/${_name}-${pkgver}" - pytest -v --device all --dtype float32,float64 test/ + cd "${srcdir}/${_name}-${pkgver}" + pytest -v --device cpu --dtype float32,float64 --cov=kornia test/ + if ! [ "$TEST_GPU" -eq "0" ]; then + pytest -v --device cuda --dtype all --cov=kornia test/ + fi } package() { - cd "${srcdir}/${_name}-${pkgver}" - python setup.py install --root="${pkgdir}/" --optimize=1 - install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + cd "${srcdir}/${_name}-${pkgver}" + python -m installer --destdir="$pkgdir" dist/*.whl + install -Dm 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } |