summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bec086ed6da454a2e11c2ab08dc09f027f67d8f5 (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
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Andrej Radović <r.andrej@gmail.com>
pkgname=python-inventree-part-import-git
pkgver=1.9.0.r0.gc2b7d84
pkgrel=1
pkgdesc="CLI to import parts from into your InvenTree instance"
url="https://github.com/30350n/inventree_part_import"
depends=(
    'python-beautifulsoup4'
    'python-browser-cookie3'
    'python-click'
    'python-cutie'
    'python-digikey-api'
    'python-error-helper'
    'python-fake-useragent'
    'python-inventree'
    'python-isocodes'
    'python-mouser'
    'python-platformdirs'
    'python-requests'
    'python-requests-oauthlib'
    'python-tablib'
    'python-thefuzz'
    'python-yaml'
)
makedepends=(python-build python-installer python-wheel python-poetry)
license=('MIT')
arch=('any')
source=(
    "$pkgname::git+https://github.com/30350n/inventree_part_import.git"
    "error_helper::git+https://github.com/30350n/error_helper.git"
)
sha256sums=('SKIP'
            'SKIP')
conflicts=('python-inventree-part-import')
provides=("python-inventree-part-import=${pkgver}")

pkgver() {
    cd "$pkgname"
    git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$srcdir/$pkgname"
    git submodule init
    git config submodule.inventree_part_import/error_helper.url "$srcdir/error_helper"
    git -c protocol.file.allow=always submodule update
}

build() {
    cd "$srcdir/$pkgname"
	rm -rf build/ dist/ *.egg-info/
    python -m build --wheel --no-isolation
}

package() {
    cd "$srcdir/$pkgname"
    python -m installer --destdir="$pkgdir" dist/*.whl
}