39 lines
1.6 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgname=python-pytest-httpbin
pkgver=2.0.0
pkgrel=3
pkgdesc='A py.test fixture for httpbining code'
arch=(any)
license=('MIT')
url='https://github.com/kevin1024/pytest-httpbin'
depends=('python-pytest' 'httpbin')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-requests')
source=("https://github.com/kevin1024/pytest-httpbin/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
$pkgname-LICENSE::https://raw.githubusercontent.com/kevin1024/pytest-httpbin/0bd7637a5c59b1a8376b9a4f051b02a97abb8c1b/LICENSE)
sha512sums=('62876590bacae6601739f5cc2eccb087024e16731afc9613b5e6928c2a2f64b73418ddcb3c4f13a4bfe1f074510f922d85411d05ebf66f123a4a09d535771b64'
'64e7f080f69371711a2181dc7c072e1e4770914b577daae141deab447d781bddd1eae8a79eda367549ed7830de3d80c1a29d7139478f547e40bed62f2d75a3ca')
build() {
cd pytest-httpbin-$pkgver
python -m build -nw
}
check() {
# Hack entry points by installing it
# https://github.com/kevin1024/pytest-httpbin/issues/64
cd pytest-httpbin-$pkgver
python -m installer -d tmp_install dist/*.whl
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
PYTHONPATH="$PWD/tmp_install/$site_packages" pytest --deselect tests/test_server.py::test_redirect_location_is_https_for_secure_server
}
package() {
cd pytest-httpbin-$pkgver
python -m installer -d "$pkgdir" dist/*.whl
install -Dm644 ../$pkgname-LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}