diff --git a/mingw-w64-python-hypothesis/PKGBUILD b/mingw-w64-python-hypothesis/PKGBUILD new file mode 100644 index 0000000000..c0539522be --- /dev/null +++ b/mingw-w64-python-hypothesis/PKGBUILD @@ -0,0 +1,146 @@ +# Maintainer: J. Peter Mugaas + +_realname=hypothesis +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +pkgver=3.66.1 +pkgrel=1 +pkgdesc="Advanced Quickcheck style testing library for Python (mingw-w64)" +arch=('any') +url='https://hypothesis.readthedocs.org' +license=('MIT') +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python3-attrs" + "${MINGW_PACKAGE_PREFIX}-python2-attrs" + "${MINGW_PACKAGE_PREFIX}-python3-coverage" + "${MINGW_PACKAGE_PREFIX}-python2-coverage" + "${MINGW_PACKAGE_PREFIX}-python2-enum34" + "${MINGW_PACKAGE_PREFIX}-python3-setuptools" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools") +#checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest-runner" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-runner" +# "${MINGW_PACKAGE_PREFIX}-flake8" +# "${MINGW_PACKAGE_PREFIX}-python2-flake8" +# "${MINGW_PACKAGE_PREFIX}-python3-pytz" +# "${MINGW_PACKAGE_PREFIX}-python2-pytz" +# "${MINGW_PACKAGE_PREFIX}-python3-numpy" +# "${MINGW_PACKAGE_PREFIX}-python2-numpy" +# "${MINGW_PACKAGE_PREFIX}-python3-faker" +# "${MINGW_PACKAGE_PREFIX}-python2-faker" +# "${MINGW_PACKAGE_PREFIX}-python3-flaky" +# "${MINGW_PACKAGE_PREFIX}-python2-flaky" +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-benchmark" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-benchmark" +# "${MINGW_PACKAGE_PREFIX}-python3-django" +# "${MINGW_PACKAGE_PREFIX}-python2-django" +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-xdist" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-xdist" +# "${MINGW_PACKAGE_PREFIX}-python3-mock" +# "${MINGW_PACKAGE_PREFIX}-python2-mock" +# "${MINGW_PACKAGE_PREFIX}-python3-pandas" +# "${MINGW_PACKAGE_PREFIX}-python2-pandas") +options=('staticlibs' 'strip' '!debug') +source=("${_realname}-$pkgver.tar.gz"::"https://github.com/HypothesisWorks/hypothesis/archive/hypothesis-python-$pkgver.tar.gz") +sha512sums=('b979e6c15a7a7c6f96f9addd49f4e308bd8d9e962187587508c332843d81acdb5ba490d7430fd10c703f013a3b250d5302fbc279d99ba89a2dcb20dc0efcbb26') + +# 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 + for builddir in python{2,3}-build-${CARCH}; do + rm -rf ${builddir} | true + cp -r "${_realname}-${_realname}-python-${pkgver}" "${builddir}" + done + # 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() { + for pver in {2,3}; do + msg "Python ${pver} build for ${CARCH}" + cd "${srcdir}/python${pver}-build-${CARCH}/hypothesis-python" + ${MINGW_PREFIX}/bin/python${pver} setup.py build + done +} + +check() { + for pver in {2,3}; do + msg "Python ${pver} test for ${CARCH}" + cd "${srcdir}/python${pver}-build-${CARCH}/hypothesis-python" + ${MINGW_PREFIX}/bin/python${pver} setup.py check + done +} + +package_python3-hypothesis() { + 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") + + 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 +} + +package_python2-hypothesis() { + depends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python2-attrs" + "${MINGW_PACKAGE_PREFIX}-python2-coverage" + "${MINGW_PACKAGE_PREFIX}-python2-enum34") + optdepends=("${MINGW_PACKAGE_PREFIX}-python2-pytz: for datetime and django module" + "${MINGW_PACKAGE_PREFIX}-python2-faker: for fakefactory and django module" + "${MINGW_PACKAGE_PREFIX}-python2-django: for django module" + "${MINGW_PACKAGE_PREFIX}-python2-numpy: for numpy module" + "${MINGW_PACKAGE_PREFIX}-python2-pytest: for pytest module") + + cd "${srcdir}/python2-build-${CARCH}/hypothesis-python" + MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \ + ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \ + --root="${pkgdir}" --optimize=1 --skip-build +} + +package_mingw-w64-i686-python2-hypothesis() { + package_python2-hypothesis +} + +package_mingw-w64-i686-python3-hypothesis() { + package_python3-hypothesis +} + +package_mingw-w64-x86_64-python2-hypothesis() { + package_python2-hypothesis +} + +package_mingw-w64-x86_64-python3-hypothesis() { + package_python3-hypothesis +}