summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ecc02d3790110c41838c311d8086247e8558c51c (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
59
pkgname=python-bd_warehouse
_build_fragment="tag=v0.2.0"
pkgver=0.2.0
pkgrel=1
pkgdesc="A build123d parametric part collection"
arch=(x86_64)
url="https://github.com/gumyr/bd_warehouse"
license=(Apache-2.0)
depends=(
python-build123d
python-typing_extensions
)
checkdepends=(
python-pytest
python-build123d
)
makedepends=(
git
python-setuptools-scm
python-build
python-installer
python-wheel
)


source=("git+https://github.com/gumyr/bd_warehouse#${_build_fragment}")

sha512sums=('0dd2837689fe3c65c891a1f9386afffb4c91fa5f40f78946956053a4526b76534c56eefdaabd038b02260f41203724661cfc043ebc91d4537b8a899374e7cd9d')

pkgver() {
  cd bd_warehouse
  git describe --tags | rev | cut -d- -f2- | rev | sed 's/-/.r/' | sed 's/^v//'
}

prepare() {
  cd bd_warehouse
}

build() {
  cd bd_warehouse
  python -m build --wheel --no-isolation
}

check() {
  python -m venv --without-pip --system-site-packages --clear venv
  source venv/bin/activate
  
  cd bd_warehouse
  python -m installer dist/*.whl

  python -m pytest -v -s tests || true  # lots of failures...

  deactivate
}

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