# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-tornado
pkgver=0.8.1
pkgrel=11
pkgdesc='A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications.'
arch=('any')
license=('Apache-2.0')
url='https://github.com/eugeniy/pytest-tornado'
depends=('python-pytest' 'python-tornado' 'python-setuptools' 'python-packaging')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel')
source=("git+https://github.com/eugeniy/pytest-tornado#tag=v$pkgver"
        "python-pytest-tornado-0.8.1-remove-pkg_resources.patch")
sha512sums=('a49353c8224020995e86eed1c0aec04fe6999255611ebed5b864b9d5d015629c50f13cf21f7c2b84a813a249dc2becfda903673604dec57a2c131301e78fad27'
            'a3574b9a90e6fc6b48c5ff0a742e549cf368496b6e02557bd6f1592aec4b38b2bd05066bad468a78295fa8bf803f9f550ed2f2dc6f52b3ef6f28045bb76fb289')

prepare() {
  cd pytest-tornado
  patch -Np1 -i ../python-pytest-tornado-0.8.1-remove-pkg_resources.patch
}

build() {
  cd pytest-tornado
  python -m build --wheel --no-isolation
}

check() {
  # Hack entry points by installing it

  cd pytest-tornado
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd pytest-tornado
  python -m installer --destdir="$pkgdir" dist/*.whl
}

# vim:set ts=2 sw=2 et:
