From 4999cff9fc5ae8ea80d5a99b5efc8d88602f0371 Mon Sep 17 00:00:00 2001 From: "J. Peter Mugaas" Date: Sat, 25 Aug 2018 13:42:58 -0400 Subject: [PATCH] =?UTF-8?q?Some=20packages=20for=20running=20python-pytest?= =?UTF-8?q?-benchmark=20-=20needed=20to=20test=20py=E2=80=A6=20(#4306)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Some packages for running python-pytest-benchmark - needed to test python-hypothesis python2-pathlib - 1.0.1 - new package for building and use by python-pytest-benchmark python-pytest-runner - 4.2 - clarified and corrected dependencies and build requirements python2-statistics - 1.0.3.5 - New package for building and use by python-pytest-benchmark python-py-cpuinfo - 4.0.8 - New package for building and use by python-pytest-benchmark * Various fixes suggested Alexpux --- mingw-w64-python-py-cpuinfo/PKGBUILD | 141 ++++++++++++++ .../py-cpuinfo2-i686.install | 14 ++ .../py-cpuinfo2-x86_64.install | 14 ++ .../py-cpuinfo3-i686.install | 14 ++ .../py-cpuinfo3-x86_64.install | 14 ++ mingw-w64-python-pytest-benchmark/PKGBUILD | 182 ++++++++++++++++++ .../pytest-benchmark2-i686.install | 18 ++ .../pytest-benchmark2-x86_64.install | 18 ++ .../pytest-benchmark3-i686.install | 18 ++ .../pytest-benchmark3-x86_64.install | 18 ++ mingw-w64-python-pytest-runner/PKGBUILD | 43 +++-- mingw-w64-python2-pathlib/PKGBUILD | 37 ++++ mingw-w64-python2-statistics/PKGBUILD | 39 ++++ 13 files changed, 552 insertions(+), 18 deletions(-) create mode 100644 mingw-w64-python-py-cpuinfo/PKGBUILD create mode 100644 mingw-w64-python-py-cpuinfo/py-cpuinfo2-i686.install create mode 100644 mingw-w64-python-py-cpuinfo/py-cpuinfo2-x86_64.install create mode 100644 mingw-w64-python-py-cpuinfo/py-cpuinfo3-i686.install create mode 100644 mingw-w64-python-py-cpuinfo/py-cpuinfo3-x86_64.install create mode 100644 mingw-w64-python-pytest-benchmark/PKGBUILD create mode 100644 mingw-w64-python-pytest-benchmark/pytest-benchmark2-i686.install create mode 100644 mingw-w64-python-pytest-benchmark/pytest-benchmark2-x86_64.install create mode 100644 mingw-w64-python-pytest-benchmark/pytest-benchmark3-i686.install create mode 100644 mingw-w64-python-pytest-benchmark/pytest-benchmark3-x86_64.install create mode 100644 mingw-w64-python2-pathlib/PKGBUILD create mode 100644 mingw-w64-python2-statistics/PKGBUILD diff --git a/mingw-w64-python-py-cpuinfo/PKGBUILD b/mingw-w64-python-py-cpuinfo/PKGBUILD new file mode 100644 index 0000000000..4d83121ec7 --- /dev/null +++ b/mingw-w64-python-py-cpuinfo/PKGBUILD @@ -0,0 +1,141 @@ +# Maintainer: J. Peter Mugaas + +_realname=py-cpuinfo +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +pkgver=4.0.0 +_commit=202e2fe4a362c9558cae074e7dbff1173d030437 +pkgrel=1 +pkgdesc="Get CPU info with pure Python 2 & 3 (mingw-w64)" +arch=('any') +url='https://github.com/workhorsy/py-cpuinfo' +license=('MIT') +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python3-setuptools" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools") +checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest-runner" + "${MINGW_PACKAGE_PREFIX}-python2-pytest-runner") +source=("${_realname}-${_commit}.tar.gz"::"https://github.com/workhorsy/py-cpuinfo/archive/$_commit.tar.gz") +sha256sums=('01edde0df583c7b62a38e32956ad2fae92d680c0ce6b7fb7dd53c87de95ea6b7') + +# 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}" + for builddir in python{2,3}-build-${CARCH}; do + rm -rf ${builddir} | true + cp -r "${_realname}-${_commit}" "${builddir}" + done + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver +} + +# 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}" + ${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}" + ${MINGW_PREFIX}/bin/python${pver} setup.py pytest + done +} + +package_python3-py-cpuinfo() { + depends=("${MINGW_PACKAGE_PREFIX}-python3") + install=${_realname}3-${CARCH}.install + + cd "${srcdir}/python3-build-${CARCH}" + 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 + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING" + +# This entire section should be removed if the package does NOT install +# anything in the /mingw*/bin directory. +### begin section ### + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + # fix python command in files + for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do + sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f} + done +#### end section #### +} + +package_python2-py-cpuinfo() { + depends=("${MINGW_PACKAGE_PREFIX}-python2") + install=${_realname}2-${CARCH}.install + + cd "${srcdir}/python2-build-${CARCH}" + 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 + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING" + +# This entire section should be removed if the package does NOT install +# anything in the /mingw*/bin directory. +### begin section ### + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + # fix python command in files + for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do + sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f} + done + +# for Python2 packages, you want to rename some stuff from the bin directory +# with the 2 suffix like in the mingw-w64-python-pygments package to avoid +# conflicts when installing both the Python2 and Python3 packages + for f in cpuinfo; do + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe + if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest + sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest + fi + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py + done +#### end section #### +} + +package_mingw-w64-i686-python2-py-cpuinfo() { + package_python2-py-cpuinfo +} + +package_mingw-w64-i686-python3-py-cpuinfo() { + package_python3-py-cpuinfo +} + +package_mingw-w64-x86_64-python2-py-cpuinfo() { + package_python2-py-cpuinfo +} + +package_mingw-w64-x86_64-python3-py-cpuinfo() { + package_python3-py-cpuinfo +} diff --git a/mingw-w64-python-py-cpuinfo/py-cpuinfo2-i686.install b/mingw-w64-python-py-cpuinfo/py-cpuinfo2-i686.install new file mode 100644 index 0000000000..2d02ead877 --- /dev/null +++ b/mingw-w64-python-py-cpuinfo/py-cpuinfo2-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in cpuinfo2; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-py-cpuinfo/py-cpuinfo2-x86_64.install b/mingw-w64-python-py-cpuinfo/py-cpuinfo2-x86_64.install new file mode 100644 index 0000000000..54f35152bf --- /dev/null +++ b/mingw-w64-python-py-cpuinfo/py-cpuinfo2-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in cpuinfo2; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-py-cpuinfo/py-cpuinfo3-i686.install b/mingw-w64-python-py-cpuinfo/py-cpuinfo3-i686.install new file mode 100644 index 0000000000..7e87a60c8e --- /dev/null +++ b/mingw-w64-python-py-cpuinfo/py-cpuinfo3-i686.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in cpuinfo; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-py-cpuinfo/py-cpuinfo3-x86_64.install b/mingw-w64-python-py-cpuinfo/py-cpuinfo3-x86_64.install new file mode 100644 index 0000000000..e7a6f269b7 --- /dev/null +++ b/mingw-w64-python-py-cpuinfo/py-cpuinfo3-x86_64.install @@ -0,0 +1,14 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in cpuinfo; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pytest-benchmark/PKGBUILD b/mingw-w64-python-pytest-benchmark/PKGBUILD new file mode 100644 index 0000000000..aa35a45108 --- /dev/null +++ b/mingw-w64-python-pytest-benchmark/PKGBUILD @@ -0,0 +1,182 @@ +# Maintainer: J. Peter Mugaas . + +_realname=pytest-benchmark +pkgbase=mingw-w64-python-${_realname} +pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") +pkgver=3.1.1 +pkgrel=1 +pkgdesc="A py.test fixture for benchmarking code (mingw-w64)" +arch=('any') +url='https://github.com/ionelmc/pytest-benchmark' +license=('BSD') +makedepends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python2-pathlib" + "${MINGW_PACKAGE_PREFIX}-python3-py-cpuinfo" + "${MINGW_PACKAGE_PREFIX}-python2-py-cpuinfo" + "${MINGW_PACKAGE_PREFIX}-python2-statistics" + "${MINGW_PACKAGE_PREFIX}-python3-setuptools" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools") +#checkdepends=("mercurial" +# "${MINGW_PACKAGE_PREFIX}-python3-aspectlib" +# "${MINGW_PACKAGE_PREFIX}-python2-aspectlib" +# "${MINGW_PACKAGE_PREFIX}-python-elasticsearch" +# "${MINGW_PACKAGE_PREFIX}-python2-elasticsearch" +# "${MINGW_PACKAGE_PREFIX}-python3-freezegun" +# "${MINGW_PACKAGE_PREFIX}-python2-freezegun" +# "${MINGW_PACKAGE_PREFIX}-python2-mock" +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-cov" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-cov" +# "${MINGW_PACKAGE_PREFIX}-python3-pygal" +# "${MINGW_PACKAGE_PREFIX}-python2-pygal" +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-runner" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-runner" +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-xdist" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-xdist") +options=('staticlibs' 'strip' '!debug') +source=("${_realname}-$pkgver.tar.gz"::"https://github.com/ionelmc/pytest-benchmark/archive/v$pkgver.tar.gz") +sha256sums=('b05e2b2b8443e049a9a9789271bcc25d03a686fc9b4b26c09052db17008e9e90') + +# 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}" + for builddir in python{2,3}-build-${CARCH}; do + rm -rf ${builddir} | true + cp -r "${_realname}-${pkgver}" "${builddir}" + done + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver +} + +# 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}" + ${MINGW_PREFIX}/bin/python${pver} setup.py build + done +} + +#check() { +# for pver in {2,3}; do +# # Hack entry points by installing it +# # Test should be related to pytest 2.9 +# +# msg "Python ${pver} test for ${CARCH}" +# cd "${srcdir}/python${pver}-build-${CARCH}" +# +# ${MINGW_PREFIX}/bin/python${pver} install --root="$PWD/tmp_install" --optimize=1 +# if [ "${pver}" = "2" ]; then +# PYTHONPATH="$PWD/tmp_install/usr/lib/python3.6/site-packages:$PYTHONPATH" PATH="$PWD/tmp_install/usr/bin:$PATH" ${MINGW_PREFIX}/bin/python3 setup.py pytest --addopts=tests || warning "Tests failed" +# else +# PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH" PATH="$PWD/tmp_install/usr/bin:$PATH" ${MINGW_PREFIX}/bin/python2 setup.py pytest --addopts=tests || warning "Tests failed" +# fi +# done +#} + +package_python3-pytest-benchmark() { + depends=("${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python3-py-cpuinfo" + "${MINGW_PACKAGE_PREFIX}-python3-pytest") + install=${_realname}3-${CARCH}.install + + cd "${srcdir}/python3-build-${CARCH}" + 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 + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING" + +# This entire section should be removed if the package does NOT install +# anything in the /mingw*/bin directory. +### begin section ### + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + # fix python command in files + for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do + sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f} + done +#### end section #### +} + +package_python2-pytest-benchmark() { + depends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python2-py-cpuinfo" + "${MINGW_PACKAGE_PREFIX}-python2-statistics" + "${MINGW_PACKAGE_PREFIX}-python2-pathlib" + "${MINGW_PACKAGE_PREFIX}-python2-pytest") + install=${_realname}2-${CARCH}.install + + cd "${srcdir}/python2-build-${CARCH}" + 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 + + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING" + +# This entire section should be removed if the package does NOT install +# anything in the /mingw*/bin directory. +### begin section ### + local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX}) + # fix python command in files + for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do + sed -e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f} + done + +# for Python2 packages, you want to rename some stuff from the bin directory +# with the 2 suffix like in the mingw-w64-python-pygments package to avoid +# conflicts when installing both the Python2 and Python3 packages + for f in pytest-benchmark; do + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe + if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest + sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest + fi + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py + done + for f in py.test-benchmark; do + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe + if [ -f "${pkgdir}${MINGW_PREFIX}"/bin/${f}.exe.manifest ]; then + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}.exe.manifest + sed -e "s|${f}|${f}2|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/${f}2.exe.manifest + fi + mv "${pkgdir}${MINGW_PREFIX}"/bin/${f}{,2}-script.py + done +#### end section #### +} + +package_mingw-w64-i686-python2-pytest-benchmark() { + package_python2-pytest-benchmark +} + +package_mingw-w64-i686-python3-pytest-benchmark() { + package_python3-pytest-benchmark +} + +package_mingw-w64-x86_64-python2-pytest-benchmark() { + package_python2-pytest-benchmark +} + +package_mingw-w64-x86_64-python3-pytest-benchmark() { + package_python3-pytest-benchmark +} diff --git a/mingw-w64-python-pytest-benchmark/pytest-benchmark2-i686.install b/mingw-w64-python-pytest-benchmark/pytest-benchmark2-i686.install new file mode 100644 index 0000000000..fc4c43c8b7 --- /dev/null +++ b/mingw-w64-python-pytest-benchmark/pytest-benchmark2-i686.install @@ -0,0 +1,18 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in py.test-benchmark2; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done + for _it in pytest-benchmark2; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pytest-benchmark/pytest-benchmark2-x86_64.install b/mingw-w64-python-pytest-benchmark/pytest-benchmark2-x86_64.install new file mode 100644 index 0000000000..e78923c745 --- /dev/null +++ b/mingw-w64-python-pytest-benchmark/pytest-benchmark2-x86_64.install @@ -0,0 +1,18 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in py.test-benchmark2; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done + for _it in pytest-benchmark2; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pytest-benchmark/pytest-benchmark3-i686.install b/mingw-w64-python-pytest-benchmark/pytest-benchmark3-i686.install new file mode 100644 index 0000000000..ab2543a52a --- /dev/null +++ b/mingw-w64-python-pytest-benchmark/pytest-benchmark3-i686.install @@ -0,0 +1,18 @@ +post_install() { + cd mingw32 + local _prefix=$(pwd -W) + cd - + local _it + for _it in py.test-benchmark; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done + for _it in pytest-benchmark; do + sed -e "s|/mingw32|${_prefix}|g" \ + -i mingw32/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pytest-benchmark/pytest-benchmark3-x86_64.install b/mingw-w64-python-pytest-benchmark/pytest-benchmark3-x86_64.install new file mode 100644 index 0000000000..ba062f42f3 --- /dev/null +++ b/mingw-w64-python-pytest-benchmark/pytest-benchmark3-x86_64.install @@ -0,0 +1,18 @@ +post_install() { + cd mingw64 + local _prefix=$(pwd -W) + cd - + local _it + for _it in py.test-benchmark; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done + for _it in pytest-benchmark; do + sed -e "s|/mingw64|${_prefix}|g" \ + -i mingw64/bin/${_it}-script.py + done +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-python-pytest-runner/PKGBUILD b/mingw-w64-python-pytest-runner/PKGBUILD index 1d3a2f0fe5..4548c8b55c 100644 --- a/mingw-w64-python-pytest-runner/PKGBUILD +++ b/mingw-w64-python-pytest-runner/PKGBUILD @@ -1,22 +1,26 @@ # Maintainer: J. Peter Mugaas -#This value is here because some python package names have capital letters -#while there is a strong preference for lowercase letters in ArchLinux and -#MSYS packages. _realname=pytest-runner pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=4.2 -pkgrel=2 +pkgrel=4 pkgdesc="Invoke py.test as distutils command with dependency resolution (mingw-w64)" arch=('any') url='https://github.com/pytest-dev/pytest-runner' license=('MIT') -validpgpkeys=('gpg_KEY') makedepends=("${MINGW_PACKAGE_PREFIX}-python2" "${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python2-pytest" + "${MINGW_PACKAGE_PREFIX}-python2-pytest" "${MINGW_PACKAGE_PREFIX}-python3-setuptools" - "${MINGW_PACKAGE_PREFIX}-python2-setuptools") + "${MINGW_PACKAGE_PREFIX}-python2-setuptools" + "${MINGW_PACKAGE_PREFIX}-python3-setuptools-scm" + "${MINGW_PACKAGE_PREFIX}-python2-setuptools-scm") +#checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pytest-flake8" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-flake8") +# "${MINGW_PACKAGE_PREFIX}-python3-pytest-virtualenv" +# "${MINGW_PACKAGE_PREFIX}-python2-pytest-virtualenv") options=('staticlibs' 'strip' '!debug') source=("${_realname}-$pkgver.tar.gz::https://github.com/pytest-dev/${_realname}/archive/$pkgver.tar.gz") sha256sums=('SKIP') @@ -61,40 +65,43 @@ build() { done } -check() { - for pver in {2,3}; do - msg "Python ${pver} test for ${CARCH}" - cd "${srcdir}/python${pver}-build-${CARCH}" - ${MINGW_PREFIX}/bin/python${pver} setup.py egg_info -# we need the flake8 package for this +#enable only when we have "${MINGW_PACKAGE_PREFIX}-python3-pytest-virtualenv" +#check() { +# for pver in {2,3}; do +# msg "Python ${pver} test for ${CARCH}" +# cd "${srcdir}/python${pver}-build-${CARCH}" +# ${MINGW_PREFIX}/bin/python${pver} setup.py egg_info +## we need the flake8 package for this # if [ "${pver}" = "2" ]; then # PYTHONPATH="$PWD" ${MINGW_PREFIX}/bin/pytest2 # else # PYTHONPATH="$PWD" ${MINGW_PREFIX}/bin/pytest # fi - done -} +# done +#} package_python3-pytest-runner() { - depends=("${MINGW_PACKAGE_PREFIX}-python3") + depends=("${MINGW_PACKAGE_PREFIX}-python3" + "${MINGW_PACKAGE_PREFIX}-python3-pytest") cd "${srcdir}/python3-build-${CARCH}" 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 - install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING" + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE" } package_python2-pytest-runner() { - depends=("${MINGW_PACKAGE_PREFIX}-python2") + depends=("${MINGW_PACKAGE_PREFIX}-python2" + "${MINGW_PACKAGE_PREFIX}-python2-pytest") cd "${srcdir}/python2-build-${CARCH}" 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 - install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING" + install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE" } package_mingw-w64-i686-python2-pytest-runner() { diff --git a/mingw-w64-python2-pathlib/PKGBUILD b/mingw-w64-python2-pathlib/PKGBUILD new file mode 100644 index 0000000000..478e2f66f3 --- /dev/null +++ b/mingw-w64-python2-pathlib/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: J. Peter Mugaas + +_realname=pathlib +pkgbase=mingw-w64-python2-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}" +pkgver=1.0.1 +pkgrel=1 +pkgdesc="This module offers a set of classes featuring all the common operations on paths in an easy, object-oriented way" +arch=('any') +url="https://pathlib.readthedocs.org/en/${pkgver}/" +license=('MIT') +depends=("${MINGW_PACKAGE_PREFIX}-python2") +makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools") +source=("https://files.pythonhosted.org/packages/source/p/pathlib/pathlib-${pkgver}.tar.gz") +sha512sums=('d85e45dfcc85ce75a7e7b609163dc8c75c688f279c1833510185f280af5501e473376dc09bddc6a804d1fcc3177a939db85af37b7b8d5b183b9bc2b85b3b0f8b') + +prepare() { + cd "${srcdir}" + rm -rf python2-build-${CARCH}| true + cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}" + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver +} + +build() { + msg "Python 2 build for ${CARCH}" + cd "${srcdir}/python2-build-${CARCH}" + ${MINGW_PREFIX}/bin/python2 setup.py build +} + +package() { + cd "${srcdir}/python2-build-${CARCH}" + 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 + install -Dm644 LICENSE.txt "$pkgdir${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENSE.txt" +} diff --git a/mingw-w64-python2-statistics/PKGBUILD b/mingw-w64-python2-statistics/PKGBUILD new file mode 100644 index 0000000000..300bdd3009 --- /dev/null +++ b/mingw-w64-python2-statistics/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: J. Peter Mugaas + +_realname=statistics +pkgbase=mingw-w64-python2-${_realname} +pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}" +pkgver=1.0.3.5 +pkgrel=1 +pkgdesc="A Python 2.* port of 3.4 Statistics Module (mingw-w64)" +arch=('any') +url='https://pypi.python.org/pypi/statistics' +license=('PSF') +depends=("${MINGW_PACKAGE_PREFIX}-python2-docutils") +makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools") +source=("https://pypi.python.org/packages/source/s/${_realname#*-}/${_realname#*-}-${pkgver}.tar.gz") +sha512sums=('1d7fd2304a885dbd9ebc564323349f9c5ad1ea1ecea8182b52a1f42308963bd49f07c9dc9f0b87a35d2f6ed3c37429dbc38183c0b1bd65a527558e4504a9a3a0') + +prepare() { + cd "${srcdir}" + rm -rf python2-build-${CARCH}| true + cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}" + # Set version for setuptools_scm + export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver +} + +build() { + msg "Python 2 build for ${CARCH}" + cd "${srcdir}/python2-build-${CARCH}" + ${MINGW_PREFIX}/bin/python2 setup.py build +} + +package() { + cd "${srcdir}/python2-build-${CARCH}" + + 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 + + install -dm 755 "${pkgdir}"${MINGW_PREFIX}/share/licenses/python2-${_realname} +}