Files
MINGW-packages/mingw-w64-python-hypothesis/PKGBUILD
2019-12-16 13:47:29 +03:00

94 lines
3.6 KiB
Bash

# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=hypothesis
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=4.43.7
pkgrel=1
pkgdesc="Advanced Quickcheck style testing library for Python (mingw-w64)"
arch=('any')
url='https://hypothesis.readthedocs.org'
license=('MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-attrs"
"${MINGW_PACKAGE_PREFIX}-python3-coverage")
optdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytz: for datetime and django module"
"${MINGW_PACKAGE_PREFIX}-python3-faker: for fakefactory and django module"
"${MINGW_PACKAGE_PREFIX}-python3-django: for django module"
"${MINGW_PACKAGE_PREFIX}-python3-numpy: for numpy module"
"${MINGW_PACKAGE_PREFIX}-python3-pytest: for pytest module")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
#checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest-runner"
# "${MINGW_PACKAGE_PREFIX}-python3-flake8"
# "${MINGW_PACKAGE_PREFIX}-python3-pytz"
# "${MINGW_PACKAGE_PREFIX}-python3-numpy"
# "${MINGW_PACKAGE_PREFIX}-python3-faker"
# "${MINGW_PACKAGE_PREFIX}-python3-flaky"
# "${MINGW_PACKAGE_PREFIX}-python3-pytest-benchmark"
# "${MINGW_PACKAGE_PREFIX}-python3-django"
# "${MINGW_PACKAGE_PREFIX}-python3-pytest-xdist"
# "${MINGW_PACKAGE_PREFIX}-python3-mock"
# "${MINGW_PACKAGE_PREFIX}-python3-pandas")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/HypothesisWorks/hypothesis/archive/hypothesis-python-${pkgver}.tar.gz")
sha512sums=('bf074f74b1bf0d79405cb529c4e639794117a28b5e21cd6c86125dee232bb1dfa831ffda15779f46c795c0a31e896d96f0f9f197c40de89e742caca57041f8c2')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}
# =========================================== #
prepare() {
cd "${srcdir}"
sed -i "/FutureWarning/a \ filterwarnings('ignore', category=DeprecationWarning, module='pandas.core')" \
${_realname}-${_realname}-python-$pkgver/hypothesis-python/tests/common/setup.py
rm -rf python3-build-${CARCH} | true
cp -r "${_realname}-${_realname}-python-${pkgver}" "python3-build-${CARCH}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
export LC_CTYPE=en_US.UTF-8
}
# Note that build() is sometimes skipped because it's done in
# the packages setup.py install for simplicity if you can do so.
# but sometimes, you want to do a check before install which would
# also trigger the build.
build() {
msg "Python 3 build for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}/hypothesis-python"
${MINGW_PREFIX}/bin/python3 setup.py build
}
# Comment out until we can get this to work.
#check() {
# msg "Python 3 test for ${CARCH}"
# cd "${srcdir}/python3-build-${CARCH}/hypothesis-python"
# mv tests/django ../
# ${MINGW_PREFIX}/bin/python3 setup.py pytest --addopts -n16
# mv ../django tests/
# PYTHONPATH="$PWD/build/lib:$PYTHONPATH" ${MINGW_PREFIX}/bin/python3 -m tests.django.manage test tests.django || warning "Tests failed"
#}
package() {
cd "${srcdir}/python3-build-${CARCH}/hypothesis-python"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
}