summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c4843ed3694e8be8a41a32f8eea248be51b4af89 (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
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=python-pytest-memray
_pkgname=${pkgname#python-}
pkgver=1.6.0
pkgrel=1
pkgdesc="A pytest plugin for easy integration of memray memory profiler"
arch=(any)
url="https://github.com/bloomberg/pytest-memray"
license=(Apache-2.0)
depends=(
  memray
  python
  python-pytest
)
makedepends=(
  python-build
  python-hatch-vcs
  python-installer
  python-wheel
)
checkdepends=(
  python-flaky
  python-pytest-xdist
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('67eb6d8a6225338f08ae05239e005601491da903077f7c28b1fdb2d06a137991')

_archive="$_pkgname-$pkgver"

build() {
  cd "$_archive"

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd "$_archive"

  rm -rf tmp_install
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  python -m installer --destdir=tmp_install dist/*.whl

  export PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH"
  pytest tests
}

package() {
  cd "$_archive"

  python -m installer --destdir="$pkgdir" dist/*.whl
}