summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1534f35af9d6a11910d89b3eb42b4e53ea148c00 (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
# Maintainer: Smoolak <smoolak@gmail.com>

pkgname=python-onnx2torch
_pkgname=onnx2torch
pkgver=1.5.15
pkgrel=1
pkgdesc='ONNX to PyTorch converter'
arch=('any')
url='https://github.com/ENOT-AutoDL/onnx2torch'
license=('Apache-2.0')
depends=(
    'python'
    'python-numpy'
    'python-onnx'
    'python-pytorch'
    'python-torchvision'
)
makedepends=(
    'python-build'
    'python-installer'
    'python-wheel'
    'python-setuptools'
)
checkdepends=(
    'python-pytest'
    'python-onnxruntime'
)
source=("$_pkgname-$pkgver.tar.gz::https://github.com/ENOT-AutoDL/onnx2torch/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('b27ead2afcdaa5d3c77bcd0e758efbdcfe07c4895f8b1fd8459309ee83c39f66')

build() {
    cd "$_pkgname-$pkgver"
    python -m build --wheel --no-isolation
}

check() {
    cd "$_pkgname-$pkgver"
    # Simple import test - full test suite requires downloading models
    PYTHONPATH="$PWD:$PYTHONPATH" python -c "from onnx2torch import convert; print('Import successful')"
}

package() {
    cd "$_pkgname-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}