archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / python-pytest-black / trunk / PKGBUILD
blobc03ce0bcbd49aea536793ac17cf9afb19d18cabd
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=python-pytest-black
4 pkgver=0.3.12
5 _commit=1d0d34a44004252ce73368ac3bf34354c06a5131
6 pkgrel=9
7 pkgdesc="A pytest plugin to enable format checking with black"
8 arch=('any')
9 license=('MIT')
10 url="https://github.com/shopkeep/pytest-black/"
11 depends=('python-black' 'python-pytest' 'python-toml')
12 makedepends=('git' 'python-setuptools-scm')
13 source=("git+https://github.com/shopkeep/pytest-black.git#commit=$_commit")
14 sha512sums=('SKIP')
16 prepare() {
17   cd pytest-black
18   # pytest 6
19   git cherry-pick -n edcbcae7d55a992e785c7fc001f9d3880b197ea2
22 build() {
23   cd pytest-black
24   python setup.py build
27 check() {
28   # Hack entry points by installing it
30   cd pytest-black
31   python setup.py install --root="$PWD/tmp_install" --optimize=1
32   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
33   PYTHONPATH="$PWD/tmp_install/$site_packages:$PYTHONPATH:$PWD/tests" py.test
36 package() {
37   cd pytest-black
38   python setup.py install --root="$pkgdir" --optimize=1
39   install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/