archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-hypothesis / trunk / PKGBUILD
blob0db3e75b996fcda2a074d1b5f7bfacd2ddaacf94
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 pkgname=python-hypothesis
4 pkgver=6.75.3
5 pkgrel=1
6 pkgdesc="Advanced Quickcheck style testing library for Python"
7 arch=('any')
8 license=('MPL')
9 url="https://hypothesis.readthedocs.org"
10 depends=('python-attrs' 'python-sortedcontainers' 'python-exceptiongroup')
11 optdepends=('python-pytz: for datetime and django module'
12             'python-faker: for fakefactory and django module'
13             'python-django: for django module'
14             'python-numpy: for numpy module'
15             'python-pytest: for pytest module'
16             'python-lark-parser: for lark module'
17             'python-libcst: for codemods module')
18 makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
19 checkdepends=('python-pytest' 'flake8' 'python-pytz' 'python-numpy' 'python-faker'
20               'python-flaky' 'python-django' 'python-pandas' 'python-dpcontracts'
21               'python-pytest-xdist' 'python-lark-parser' 'python-pexpect' 'python-coverage'
22               'python-typing_extensions' 'python-black' 'python-fakeredis' 'python-libcst')
23 source=("$pkgname-$pkgver.tar.gz::https://github.com/HypothesisWorks/hypothesis/archive/hypothesis-python-$pkgver.tar.gz")
24 sha512sums=('2e31f2f5483abf4c749dc3ef2758e51b62072e36f257777cecd71ea8f67a08987f5547bc9476dd2dbf8e9a6488fbe76d3d8ae83666bc2e80a2f26ea807cb15aa')
26 prepare() {
27   mv hypothesis-hypothesis-python-$pkgver hypothesis-$pkgver
30 build() {
31   cd hypothesis-$pkgver/hypothesis-python
33   python -m build -nw
36 check() {
37   cd hypothesis-$pkgver/hypothesis-python
39   python setup.py install --root="$PWD/tmp_install" --optimize=1
40   python examples/example_hypothesis_entrypoint/setup.py install --root="$PWD/tmp_install" --optimize=1
42   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
43   PYTHONPATH="$PWD/tmp_install/$site_packages:$PWD/examples/example_hypothesis_entrypoint" \
44   PATH="$PWD/tmp_install/usr/bin:$PATH" \
45     pytest --ignore tmp_install || echo "Tests failed"
48 package() {
49   cd hypothesis-$pkgver/hypothesis-python
51   python -m installer -d "$pkgdir" dist/*.whl
53   # It's only present when tests are enabled, so adding -f
54   local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
55   rm -rf "$pkgdir"/$site_packages/tests