summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 95e277c3f740a4f05f486d6d9584b97d6eaf7abe (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.11.0'
pkgrel=1
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=(
  '9da8ce9c9115be6cc604d59e82d74bb8e54c2c494373f883d7defcde37a7b1f305ba8b2c5b00dc9bb056e0c3eb8192de227ce497185839b9d5db400a8553868a'
)

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"
}