summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8150e88ae17bd01f559bcb6755bf0981bf246c97 (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
# Maintainer: Brian Thompson <brianrobt@pm.me>

pkgname='python-conda-package-streaming'
pkgver='0.10.0'
pkgrel=4
pkgdesc='An efficient library to read from new and old format .conda and .tar.bz2 conda packages'
_srcname="conda-package-streaming-${pkgver}"
arch=('x86_64')
url='https://github.com/conda/conda-package-streaming'
license=('BSD-3-Clause')
depends=(
  'python'
  'python-requests'
  'python-zstandard'
)
makedepends=(
  'python-build'
  'python-installer'
  'python-flit-core'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-pytest'
  'python-pytest-cov'
  'python-pytest-mock'
  'python-boto3'
  'python-bottle'
)
source=(
  "${_srcname}.tar.gz::https://github.com/conda/conda-package-streaming/archive/refs/tags/v${pkgver}.tar.gz"
)
sha512sums=(
  'f4f1efb609a77a4c28e230e1c23b0ee65f682228643dc93bb4055edd3111e31f853f5af672bd551d09e219374589d110f349c3f4899c5f881cae25600ba0eceb'
)

build() {
  cd "$srcdir/$_srcname"
  python -m build --wheel --no-isolation
}

# TODO: Get unit tests working
# check() {
#   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
#   cd "$srcdir/$_srcname"
#   python -m installer --destdir="test_dir" dist/*.whl
#   export PYTHONPATH="$PWD/test_dir/$site_packages:$PYTHONPATH"
#   pytest -vv
# }

package() {
  cd "$srcdir/$_srcname"
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}