summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7a08294091a563964c5151ceb3a63b5b0cd4ef9f (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
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-black
pkgver=0.3.12
pkgrel=6
pkgdesc="A pytest plugin to enable format checking with black"
arch=('any')
license=('MIT')
url="https://github.com/shopkeep/pytest-black/"
depends=('python-black' 'python-pytest' 'python-toml')
makedepends=('python-setuptools-scm')
source=("$pkgname-$pkgver.tar.gz::https://github.com/shopkeep/pytest-black/archive/$pkgver.tar.gz"
        $pkgname-pytest6.patch::https://github.com/shopkeep/pytest-black/pull/53.patch)
sha512sums=('1576761c9a93e6a05d5f1d40200e228791a67ac33f437330940ccbb898121df22814a794858b36de9223d4cc45d58fcbefaa08c87275f36e04901cb4cd217760'
            '362176d305114dc1f6389144ab8feed5a1e48827bef4d07b241accfa5a257ba8189dbbe4c320ae458a47cd067541d53d2ae0b66688b5fcdd698f31ac3df62d19')

export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver

prepare() {
  cd pytest-black-$pkgver
  patch -Np1 -i ../$pkgname-pytest6.patch
}

build() {
  cd pytest-black-$pkgver
  python setup.py build
}

check() {
  # Hack entry points by installing it

  cd pytest-black-$pkgver
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  PYTHONPATH="$PWD/tmp_install/usr/lib/python3.10/site-packages:$PYTHONPATH:$PWD/tests" py.test
}

package() {
  cd pytest-black-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}