A bundle of python packages I was working on. These are checked in together since they depend upon eachother. (#4129)

contextlib2
linecache2
traceback2
unittest2
python-extras
fixtures
pyrsistent
subunit
testscenerios
testtools
This commit is contained in:
J. Peter Mugaas
2018-07-31 04:29:12 -04:00
committed by Алексей
parent f0d09968b6
commit 4d9ec2ac59
23 changed files with 1948 additions and 0 deletions

View File

@@ -0,0 +1,109 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=extras
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.0.0
pkgrel=1
pkgdesc="Useful extra bits for Python - things that should be in the standard library (mingw-w64)"
arch=('any')
url='https://github.com/testing-cabal/extras'
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-testtools"
"${MINGW_PACKAGE_PREFIX}-python2-testtools")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-$pkgver.tar.gz"::"https://github.com/testing-cabal/extras/archive/$pkgver.tar.gz")
sha256sums=('fe6c15e75040b8825d5677df2aaed7105182ece4db3b402b02371b98e7a5b518')
# 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}"
# apply_patch_with_msg 0001-A-really-important-fix.patch \
# 0002-A-less-important-fix.patch
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
msg "Python ${pver} test for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} -m testtools.run extras.tests.test_suite
done
}
package_python3-extras() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
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}/LICENSE"
}
package_python2-extras() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
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}/LICENSE"
}
package_mingw-w64-i686-python2-extras() {
package_python2-extras
}
package_mingw-w64-i686-python3-extras() {
package_python3-extras
}
package_mingw-w64-x86_64-python2-extras() {
package_python2-extras
}
package_mingw-w64-x86_64-python3-extras() {
package_python3-extras
}

View File

@@ -0,0 +1,118 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=fixtures
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=3.0.0
pkgrel=1
pkgdesc="Fixtures, reusable state for writing clean tests and more (mingw-w64)"
arch=('any')
url="https://launchpad.net/python-fixtures"
license=('Apache')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-six"
"${MINGW_PACKAGE_PREFIX}-python2-six"
"${MINGW_PACKAGE_PREFIX}-python3-testtools"
"${MINGW_PACKAGE_PREFIX}-python2-testtools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-subunit"
"${MINGW_PACKAGE_PREFIX}-python2-subunit"
"${MINGW_PACKAGE_PREFIX}-python3-mock"
"${MINGW_PACKAGE_PREFIX}-python2-mock")
options=('staticlibs' 'strip' '!debug')
source=("https://pypi.io/packages/source/f/fixtures/fixtures-$pkgver.tar.gz")
sha512sums=('e52ba864c42d15a8baa60583761006b2dd78e3cd5f3f043f5702346aef428b933d62e8fa5889b7cb4196e4072acc5df3b7ffa39702a1b782887bdc109299b695')
# 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
}
# This doesn't seem to worky
#check() {
# for pver in {2,3}; do
# msg "Python ${pver} test for ${CARCH}"
# cd "${srcdir}/python${pver}-build-${CARCH}"
# ${MINGW_PREFIX}/bin/python${pver} -m testtools.run fixtures.test_suite
# done
#}
package_python3-fixtures() {
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-six"
"${MINGW_PACKAGE_PREFIX}-python3-testtools")
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
}
package_python2-fixtures() {
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-six"
"${MINGW_PACKAGE_PREFIX}-python2-testtools")
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
}
package_mingw-w64-i686-python2-fixtures() {
package_python2-fixtures
}
package_mingw-w64-i686-python3-fixtures() {
package_python3-fixtures
}
package_mingw-w64-x86_64-python2-fixtures() {
package_python2-fixtures
}
package_mingw-w64-x86_64-python3-fixtures() {
package_python3-fixtures
}

View File

@@ -0,0 +1,22 @@
Copyright (c) 2015 Tobias Gustafsson
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,115 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=pyrsistent
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.14.4
pkgrel=1
pkgdesc="Persistent/Functional/Immutable data structures (mingw-w64)"
arch=('any')
url='https://github.com/tobgu/pyrsistent'
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"
# "${MINGW_PACKAGE_PREFIX}-python3-flake8"
# "${MINGW_PACKAGE_PREFIX}-python2-flake8"
# "${MINGW_PACKAGE_PREFIX}-python3-hypothesis"
# "${MINGW_PACKAGE_PREFIX}-python2-hypothesis")
options=('staticlibs' 'strip' '!debug')
source=("https://pypi.io/packages/source/p/pyrsistent/pyrsistent-$pkgver.tar.gz"
LICENCE.mit)
sha512sums=('6a2807be742c8aa33e8e244a449457774a9fed9a8a3d5f368f2aa91ca94904d3a8b73faec80a4e18bee48f765305fba4f8f1d2e66153a6cd3975ae412306fc35'
'036bd5cc2a62b004576ecc50a84dc7d187d8108f52cb886f7e32bed324327af2dc132100e1c8f1dd2ce35b774f74898020f04a315e5137319deda18a449e791a')
# 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
}
# For some reason, this fails complaining that atomicwrites was not
# found for python3
#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-pyrsistent() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
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 LICENCE.mit "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENCE.mit"
}
package_python2-pyrsistent() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
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 LICENCE.mit "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/LICENCE.mit"
}
package_mingw-w64-i686-python2-pyrsistent() {
package_python2-pyrsistent
}
package_mingw-w64-i686-python3-pyrsistent() {
package_python3-pyrsistent
}
package_mingw-w64-x86_64-python2-pyrsistent() {
package_python2-pyrsistent
}
package_mingw-w64-x86_64-python3-pyrsistent() {
package_python3-pyrsistent
}

View File

@@ -0,0 +1,127 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=subunit
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.3.0
pkgrel=1
pkgdesc="Python implementation of subunit test streaming protocol (mingw-w64)"
arch=('any')
url='http://launchpad.net/subunit'
license=('Apache')
validpgpkeys=('gpg_KEY')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-extras"
"${MINGW_PACKAGE_PREFIX}-python2-extras"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python3-testtools"
"${MINGW_PACKAGE_PREFIX}-python2-testtools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-fixtures"
"${MINGW_PACKAGE_PREFIX}-python2-fixtures"
"${MINGW_PACKAGE_PREFIX}-python3-hypothesis"
"${MINGW_PACKAGE_PREFIX}-python2-hypothesis"
"${MINGW_PACKAGE_PREFIX}-python3-testscenarios"
"${MINGW_PACKAGE_PREFIX}-python2-testscenarios")
options=('staticlibs' 'strip' '!debug')
source=("https://pypi.io/packages/source/p/python-subunit/python-subunit-$pkgver.tar.gz")
sha512sums=('387c9ce8ed679d8998d33c7a295412e4f9de46b8dccdfab92eb82d8c4290958760b6c9bd99d50abd0836e4556c1b0c0132fc01e16801a3113844ab1bf28cf962')
# 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 's|import unittest2 as unittest|import unittest|' python-subunit-$pkgver/python/subunit/tests/test_test_protocol.py
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "python-${_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
msg "Python ${pver} test for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
PYTHONPATH="$PWD/build/lib:$PYTHONPATH" ${MINGW_PREFIX}/bin/python${pver} -m testtools.run subunit.test_suite || warning "Tests failed"
done
}
package_python3-subunit() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
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
#fix so the correct interpretter is used
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
for name in subunit-1to2 subunit-2to1 subunit-filter subunit-ls subunit-notify subunit-output subunit-stats subunit-tags subunit2csv subunit2gtk subunit2junitxml subunit2pyunit tap2subunit subunit2disk; do
sed -e "s|${PREFIX_WIN}/bin/python3.exe|${MINGW_PREFIX}/bin/python3.exe|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/$name
done
}
package_python2-subunit() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
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
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
for name in subunit-1to2 subunit-2to1 subunit-filter subunit-ls subunit-notify subunit-output subunit-stats subunit-tags subunit2csv subunit2gtk subunit2junitxml subunit2pyunit tap2subunit subunit2disk; do
#fix so the file is a script that can run with no issues on the command-line w/o
#specifying an interpretter
sed -e "s|${PREFIX_WIN}/bin/python2.exe|${MINGW_PREFIX}/bin/python2.exe|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/$name
mv "${pkgdir}${MINGW_PREFIX}"/bin/$name{,-python2}
done
}
package_mingw-w64-i686-python2-subunit() {
package_python2-subunit
}
package_mingw-w64-i686-python3-subunit() {
package_python3-subunit
}
package_mingw-w64-x86_64-python2-subunit() {
package_python2-subunit
}
package_mingw-w64-x86_64-python3-subunit() {
package_python3-subunit
}

View File

@@ -0,0 +1,104 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=testscenarios
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.5.0
pkgrel=1
pkgdesc="estscenarios, a pyunit extension for dependency injection (mingw-w64)"
arch=('any')
url="https://launchpad.net/testscenarios"
license=('Apache')
validpgpkeys=('gpg_KEY')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
options=('staticlibs' 'strip' '!debug')
source=("https://pypi.python.org/packages/source/t/testscenarios/testscenarios-$pkgver.tar.gz")
sha512sums=('f08b868babf504482369c5cb945d3e95bca1cc00f92d5013f6898c488051be0c26dc49aaabcef362aea45450a8d041d9826fb6b5c848beec013fb102d6935521')
# 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
msg "Python ${pver} test for ${CARCH}"
cd "${srcdir}/python${pver}-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} -m testtools.run testscenarios.test_suite
done
}
package_python3-testscenarios() {
depends=("${MINGW_PACKAGE_PREFIX}-python3")
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
}
package_python2-testscenarios() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
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
}
package_mingw-w64-i686-python2-testscenarios() {
package_python2-testscenarios
}
package_mingw-w64-i686-python3-testscenarios() {
package_python3-testscenarios
}
package_mingw-w64-x86_64-python2-testscenarios() {
package_python2-testscenarios
}
package_mingw-w64-x86_64-python3-testscenarios() {
package_python3-testscenarios
}

View File

@@ -0,0 +1,137 @@
From 0a609e10198a818ba21d607107a667cb95afef0a Mon Sep 17 00:00:00 2001
From: hugovk <hugovk@users.noreply.github.com>
Date: Thu, 12 Oct 2017 23:04:13 +0300
Subject: [PATCH] Remove old Python 2.6 code
---
doc/hacking.rst | 4 ++--
scripts/all-pythons | 2 +-
testtools/tests/test_testcase.py | 11 -----------
testtools/testsuite.py | 13 ++-----------
4 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/doc/hacking.rst b/doc/hacking.rst
index cb89a9de..a3d9d04c 100644
--- a/doc/hacking.rst
+++ b/doc/hacking.rst
@@ -15,7 +15,7 @@ Coding style
In general, follow `PEP 8`_ except where consistency with the standard
library's unittest_ module would suggest otherwise.
-testtools currently supports Python 2.6 and later, including Python 3.
+testtools currently supports Python 2.7 and Python 3.3 and later.
Copyright assignment
--------------------
@@ -144,7 +144,7 @@ including conformance with this HACKING file.
Changes which all users should be made aware of should be documented in NEWS.
-We are now in full backwards compatibility mode - no more releases < 1.0.0, and
+We are now in full backwards compatibility mode - no more releases < 1.0.0, and
breaking compatibility will require consensus on the testtools-dev mailing list.
Exactly what constitutes a backwards incompatible change is vague, but coarsely:
diff --git a/scripts/all-pythons b/scripts/all-pythons
index 10fd6dea..dc0fee70 100755
--- a/scripts/all-pythons
+++ b/scripts/all-pythons
@@ -89,5 +89,5 @@ def now():
if __name__ == '__main__':
sys.path.append(ROOT)
result = TestProtocolClient(sys.stdout)
- for version in '2.6 2.7 3.0 3.1 3.2'.split():
+ for version in '2.7 3.3 3.4 3.5 3.6'.split():
run_for_python(version, result, sys.argv[1:])
diff --git a/testtools/tests/test_testcase.py b/testtools/tests/test_testcase.py
index 1622cf8d..2dbfcd0e 100644
--- a/testtools/tests/test_testcase.py
+++ b/testtools/tests/test_testcase.py
@@ -1095,7 +1095,6 @@ def test_expectFailure_KnownFailure_unexpected_success(self):
self.assertDetailsProvided(case, "addUnexpectedSuccess",
["foo", "reason"])
- @skipIf(not hasattr(unittest, 'expectedFailure'), 'Need py27+')
def test_unittest_expectedFailure_decorator_works_with_failure(self):
class ReferenceTest(TestCase):
@unittest.expectedFailure
@@ -1106,7 +1105,6 @@ def test_fails_expectedly(self):
result = test.run()
self.assertEqual(True, result.wasSuccessful())
- @skipIf(not hasattr(unittest, 'expectedFailure'), 'Need py27+')
def test_unittest_expectedFailure_decorator_works_with_success(self):
class ReferenceTest(TestCase):
@unittest.expectedFailure
@@ -1450,12 +1448,6 @@ def test_runTwice(self):
second_result._events, self.expected_second_result)
-require_py27_minimum = skipIf(
- sys.version < '2.7',
- "Requires python 2.7 or greater"
-)
-
-
class TestSkipping(TestCase):
"""Tests for skipping of tests functionality."""
@@ -1635,7 +1627,6 @@ def test_testtools_skipUnless_decorator_does_not_run_setUp(self):
reason
)
- @require_py27_minimum
def test_unittest_skip_decorator_does_not_run_setUp(self):
reason = self.getUniqueString()
self.check_skip_decorator_does_not_run_setup(
@@ -1643,7 +1634,6 @@ def test_unittest_skip_decorator_does_not_run_setUp(self):
reason
)
- @require_py27_minimum
def test_unittest_skipIf_decorator_does_not_run_setUp(self):
reason = self.getUniqueString()
self.check_skip_decorator_does_not_run_setup(
@@ -1651,7 +1641,6 @@ def test_unittest_skipIf_decorator_does_not_run_setUp(self):
reason
)
- @require_py27_minimum
def test_unittest_skipUnless_decorator_does_not_run_setUp(self):
reason = self.getUniqueString()
self.check_skip_decorator_does_not_run_setup(
diff --git a/testtools/testsuite.py b/testtools/testsuite.py
index bc9e77c6..eb2f5f87 100644
--- a/testtools/testsuite.py
+++ b/testtools/testsuite.py
@@ -10,6 +10,7 @@
'sorted_tests',
]
+from collections import Counter
from pprint import pformat
import sys
import threading
@@ -301,21 +302,11 @@ def filter_by_ids(suite_or_case, test_ids):
return suite_or_case
-# XXX: Python 2.6. Replace this with Counter when we drop 2.6 support.
-def _counter(xs):
- """Return a dict mapping values of xs to number of times they appear."""
- counts = {}
- for x in xs:
- times = counts.setdefault(x, 0)
- counts[x] = times + 1
- return counts
-
-
def sorted_tests(suite_or_case, unpack_outer=False):
"""Sort suite_or_case while preserving non-vanilla TestSuites."""
# Duplicate test id can induce TypeError in Python 3.3.
# Detect the duplicate test ids, raise exception when found.
- seen = _counter(case.id() for case in iterate_tests(suite_or_case))
+ seen = Counter(case.id() for case in iterate_tests(suite_or_case))
duplicates = dict(
(test_id, count) for test_id, count in seen.items() if count > 1)
if duplicates:

View File

@@ -0,0 +1,54 @@
From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 17 May 2018 17:52:26 +0200
Subject: [PATCH] Fix the tests on Python 3.7
Exception's repr got changed not to include trailing comma
Fixes https://github.com/testing-cabal/testtools/issues/270
---
.travis.yml | 1 +
testtools/tests/matchers/test_exception.py | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7f1f4db7..784608e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,7 @@ python:
- "3.4"
- "3.5"
- "3.6"
+ - "3.7-dev"
- "pypy"
install:
diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
index 6cd80af1..acd39252 100644
--- a/testtools/tests/matchers/test_exception.py
+++ b/testtools/tests/matchers/test_exception.py
@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
matches_matches = [error_foo]
matches_mismatches = [error_bar, error_base_foo]
+ if sys.version_info >= (3, 7):
+ # exception's repr has changed
+ _e = ''
+ else:
+ _e = ','
+
str_examples = [
- ("MatchesException(Exception('foo',))",
+ ("MatchesException(Exception('foo'%s))" % _e,
MatchesException(Exception('foo')))
]
describe_examples = [
("%r is not a %r" % (Exception, ValueError),
error_base_foo,
MatchesException(ValueError("foo"))),
- ("ValueError('bar',) has different arguments to ValueError('foo',).",
+ ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
+ % (_e, _e),
error_bar,
MatchesException(ValueError("foo"))),
]

View File

@@ -0,0 +1,212 @@
From 33dc6c8c67620863d14622df49e9834ac6fe72b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Mon, 29 May 2017 12:38:04 +0300
Subject: [PATCH] Spelling fixes (#261)
---
NEWS | 6 +++---
doc/for-framework-folk.rst | 4 ++--
testtools/assertions.py | 2 +-
testtools/matchers/_exception.py | 2 +-
testtools/testcase.py | 4 ++--
testtools/testresult/real.py | 2 +-
testtools/tests/matchers/test_exception.py | 8 ++++----
testtools/tests/test_testresult.py | 6 +++---
testtools/testsuite.py | 6 +++---
9 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/NEWS b/NEWS
index 03495e24..bf76c96b 100644
--- a/NEWS
+++ b/NEWS
@@ -104,7 +104,7 @@ Improvements
* ``MatchesListwise`` has more informative error when lengths don't match.
(Jonathan Lange)
-* The short form of errors for failed binary comparisions will now put the
+* The short form of errors for failed binary comparisons will now put the
expected value on the _right_. This means that ``assertThat(2, Equals(3))``
will raise an error saying ``2 != 3``.
(Jonathan Lange, #1525227)
@@ -274,7 +274,7 @@ Changes
our exception lookup priorities to support it. Regular skips done through
raise self.skipException will continue to work, since they were always caught
in our code - its because the suite type being used to implement setUpClass
- has changed that an issue occured.
+ has changed that an issue occurred.
(Robert Collins, #1393068)
1.2.1
@@ -295,7 +295,7 @@ Changes
* Depends on unittest2 for discovery functionality and the ``TestProgram`` base
class. This brings in many fixes made to discovery where previously we were
only using the discovery package or the version in the release of Python
- that the test execution was occuring on. (Robert Collins, #1271133)
+ that the test execution was occurring on. (Robert Collins, #1271133)
* Fixed unit tests which were failing under pypy due to a change in the way
pypy formats tracebacks. (Thomi Richards)
diff --git a/doc/for-framework-folk.rst b/doc/for-framework-folk.rst
index 4c970d7d..a91acb7f 100644
--- a/doc/for-framework-folk.rst
+++ b/doc/for-framework-folk.rst
@@ -297,7 +297,7 @@ TestResult.addSkip
This method is called on result objects when a test skips. The
``testtools.TestResult`` class records skips in its ``skip_reasons`` instance
-dict. The can be reported on in much the same way as succesful tests.
+dict. The can be reported on in much the same way as successful tests.
TestResult.time
@@ -393,7 +393,7 @@ Extensions to TestSuite
ConcurrentTestSuite
-------------------
-A TestSuite for parallel testing. This is used in conjuction with a helper that
+A TestSuite for parallel testing. This is used in conjunction with a helper that
runs a single suite in some parallel fashion (for instance, forking, handing
off to a subprocess, to a compute cloud, or simple threads).
ConcurrentTestSuite uses the helper to get a number of separate runnable
diff --git a/testtools/assertions.py b/testtools/assertions.py
index 6c5f67e7..b241df63 100644
--- a/testtools/assertions.py
+++ b/testtools/assertions.py
@@ -12,7 +12,7 @@ def assert_that(matchee, matcher, message='', verbose=False):
"""Assert that matchee is matched by matcher.
This should only be used when you need to use a function based
- matcher, assertThat in Testtools.Testcase is prefered and has more
+ matcher, assertThat in Testtools.Testcase is preferred and has more
features
:param matchee: An object to match with matcher.
diff --git a/testtools/matchers/_exception.py b/testtools/matchers/_exception.py
index cd4c90bf..23eaa601 100644
--- a/testtools/matchers/_exception.py
+++ b/testtools/matchers/_exception.py
@@ -81,7 +81,7 @@ def __str__(self):
class Raises(Matcher):
"""Match if the matchee raises an exception when called.
- Exceptions which are not subclasses of Exception propogate out of the
+ Exceptions which are not subclasses of Exception propagate out of the
Raises.match call unless they are explicitly matched.
"""
diff --git a/testtools/testcase.py b/testtools/testcase.py
index 7a10d7e0..c6166cf9 100644
--- a/testtools/testcase.py
+++ b/testtools/testcase.py
@@ -82,7 +82,7 @@ class _UnexpectedSuccess(Exception):
class _ExpectedFailure(Exception):
- """An expected failure occured.
+ """An expected failure occurred.
Note that this exception is private plumbing in testtools' testcase
module.
@@ -391,7 +391,7 @@ def addOnException(self, handler):
the exception has caused.
Handlers are called in first-added, first-called order, and if they
- raise an exception, that will propogate out of the test running
+ raise an exception, that will propagate out of the test running
machinery, halting test processing. As a result, do not call code that
may unreasonably fail.
"""
diff --git a/testtools/testresult/real.py b/testtools/testresult/real.py
index 8c5aefca..0b927c64 100644
--- a/testtools/testresult/real.py
+++ b/testtools/testresult/real.py
@@ -969,7 +969,7 @@ def stopTestRun(self):
self._hook.stopTestRun()
def wasSuccessful(self):
- """Return False if any failure has occured.
+ """Return False if any failure has occurred.
Note that incomplete tests can only be detected when stopTestRun is
called, so that should be called before checking wasSuccessful.
diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
index 9ef36b87..6cd80af1 100644
--- a/testtools/tests/matchers/test_exception.py
+++ b/testtools/tests/matchers/test_exception.py
@@ -150,17 +150,17 @@ def test_KeyboardInterrupt_matched(self):
matcher = Raises(MatchesException(KeyboardInterrupt))
self.assertThat(self.raiser, matcher)
- def test_KeyboardInterrupt_propogates(self):
- # The default 'it raised' propogates KeyboardInterrupt.
+ def test_KeyboardInterrupt_propagates(self):
+ # The default 'it raised' propagates KeyboardInterrupt.
match_keyb = Raises(MatchesException(KeyboardInterrupt))
def raise_keyb_from_match():
matcher = Raises()
matcher.match(self.raiser)
self.assertThat(raise_keyb_from_match, match_keyb)
- def test_KeyboardInterrupt_match_Exception_propogates(self):
+ def test_KeyboardInterrupt_match_Exception_propagates(self):
# If the raised exception isn't matched, and it is not a subclass of
- # Exception, it is propogated.
+ # Exception, it is propagated.
match_keyb = Raises(MatchesException(KeyboardInterrupt))
def raise_keyb_from_match():
matcher = Raises(MatchesException(Exception))
diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py
index 7b0b212d..cd96f318 100644
--- a/testtools/tests/test_testresult.py
+++ b/testtools/tests/test_testresult.py
@@ -2530,13 +2530,13 @@ def _write_module(self, name, encoding, contents):
def _test_external_case(self, testline, coding="ascii", modulelevel="",
suffix=""):
- """Create and run a test case in a seperate module"""
+ """Create and run a test case in a separate module"""
self._setup_external_case(testline, coding, modulelevel, suffix)
return self._run_external_case()
def _setup_external_case(self, testline, coding="ascii", modulelevel="",
suffix=""):
- """Create a test case in a seperate module"""
+ """Create a test case in a separate module"""
_, prefix, self.modname = self.id().rsplit(".", 2)
self.dir = tempfile.mkdtemp(prefix=prefix, suffix=suffix)
self.addCleanup(shutil.rmtree, self.dir)
@@ -2552,7 +2552,7 @@ def _setup_external_case(self, testline, coding="ascii", modulelevel="",
" %s\n" % (coding, modulelevel, testline))
def _run_external_case(self):
- """Run the prepared test case in a seperate module"""
+ """Run the prepared test case in a separate module"""
sys.path.insert(0, self.dir)
self.addCleanup(sys.path.remove, self.dir)
module = __import__(self.modname)
diff --git a/testtools/testsuite.py b/testtools/testsuite.py
index d12f1882..bc9e77c6 100644
--- a/testtools/testsuite.py
+++ b/testtools/testsuite.py
@@ -250,7 +250,7 @@ def filter_by_ids(suite_or_case, test_ids):
fails the predicate when it will return a new unittest.TestSuite with
no contents.
- This helper exists to provide backwards compatability with older versions
+ This helper exists to provide backwards compatibility with older versions
of Python (currently all versions :)) that don't have a native
filter_by_ids() method on Test(Case|Suite).
@@ -267,10 +267,10 @@ def filter_by_ids(suite_or_case, test_ids):
For anything else, it is not filtered - it is returned as-is.
- To provide compatability with this routine for a custom TestSuite, just
+ To provide compatibility with this routine for a custom TestSuite, just
define a filter_by_ids() method that will return a TestSuite equivalent to
the original minus any tests not in test_ids.
- Similarly to provide compatability for a custom TestCase that does
+ Similarly to provide compatibility for a custom TestCase that does
something unusual define filter_by_ids to return a new TestCase object
that will only run test_ids that are in the provided container. If none
would run, return an empty TestSuite().

View File

@@ -0,0 +1,127 @@
From 63d6945020f81d8e85aad7bafdb6bdd087d3ffbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Mon, 29 May 2017 12:36:47 +0300
Subject: [PATCH] Python 3.6 invalid escape sequence deprecation fixes (#262)
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
---
testtools/content.py | 2 +-
testtools/matchers/_warnings.py | 2 +-
testtools/tests/matchers/test_basic.py | 2 +-
testtools/tests/matchers/test_datastructures.py | 14 +++++++-------
testtools/tests/test_testcase.py | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/testtools/content.py b/testtools/content.py
index 78c4e3fc..8ab902f7 100644
--- a/testtools/content.py
+++ b/testtools/content.py
@@ -102,7 +102,7 @@ def iter_text(self):
no charset parameter is present in the MIME type. (This is somewhat
arbitrary, but consistent with RFC2617 3.7.1).
- :raises ValueError: If the content type is not text/\*.
+ :raises ValueError: If the content type is not text/\\*.
"""
if self.content_type.type != "text":
raise ValueError("Not a text type %r" % self.content_type)
diff --git a/testtools/matchers/_warnings.py b/testtools/matchers/_warnings.py
index 2ac5b936..21cb0913 100644
--- a/testtools/matchers/_warnings.py
+++ b/testtools/matchers/_warnings.py
@@ -21,7 +21,7 @@
def WarningMessage(category_type, message=None, filename=None, lineno=None,
line=None):
- """
+ r"""
Create a matcher that will match `warnings.WarningMessage`\s.
For example, to match captured `DeprecationWarning`\s with a message about
diff --git a/testtools/tests/matchers/test_basic.py b/testtools/tests/matchers/test_basic.py
index 519cdd82..1251b262 100644
--- a/testtools/tests/matchers/test_basic.py
+++ b/testtools/tests/matchers/test_basic.py
@@ -395,7 +395,7 @@ class TestMatchesRegex(TestCase, TestMatchersInterface):
describe_examples = [
("'c' does not match /a|b/", 'c', MatchesRegex('a|b')),
- ("'c' does not match /a\d/", 'c', MatchesRegex(r'a\d')),
+ ("'c' does not match /a\\d/", 'c', MatchesRegex(r'a\d')),
("%r does not match /\\s+\\xa7/" % (_b('c'),),
_b('c'), MatchesRegex(_b("\\s+\xA7"))),
("%r does not match /\\s+\\xa7/" % (_u('c'),),
diff --git a/testtools/tests/matchers/test_datastructures.py b/testtools/tests/matchers/test_datastructures.py
index 6a403990..d5290e6d 100644
--- a/testtools/tests/matchers/test_datastructures.py
+++ b/testtools/tests/matchers/test_datastructures.py
@@ -150,27 +150,27 @@ def test_two_too_many_matchers(self):
self.assertMismatchWithDescriptionMatching(
[3], MatchesSetwise(Equals(1), Equals(2), Equals(3)),
MatchesRegex(
- 'There were 2 matchers left over: Equals\([12]\), '
- 'Equals\([12]\)'))
+ r'There were 2 matchers left over: Equals\([12]\), '
+ r'Equals\([12]\)'))
def test_two_too_many_values(self):
self.assertMismatchWithDescriptionMatching(
[1, 2, 3, 4], MatchesSetwise(Equals(1), Equals(2)),
MatchesRegex(
- 'There were 2 values left over: \[[34], [34]\]'))
+ r'There were 2 values left over: \[[34], [34]\]'))
def test_mismatch_and_too_many_matchers(self):
self.assertMismatchWithDescriptionMatching(
[2, 3], MatchesSetwise(Equals(0), Equals(1), Equals(2)),
MatchesRegex(
- '.*There was 1 mismatch and 1 extra matcher: Equals\([01]\)',
+ r'.*There was 1 mismatch and 1 extra matcher: Equals\([01]\)',
re.S))
def test_mismatch_and_too_many_values(self):
self.assertMismatchWithDescriptionMatching(
[2, 3, 4], MatchesSetwise(Equals(1), Equals(2)),
MatchesRegex(
- '.*There was 1 mismatch and 1 extra value: \[[34]\]',
+ r'.*There was 1 mismatch and 1 extra value: \[[34]\]',
re.S))
def test_mismatch_and_two_too_many_matchers(self):
@@ -179,13 +179,13 @@ def test_mismatch_and_two_too_many_matchers(self):
Equals(0), Equals(1), Equals(2), Equals(3)),
MatchesRegex(
'.*There was 1 mismatch and 2 extra matchers: '
- 'Equals\([012]\), Equals\([012]\)', re.S))
+ r'Equals\([012]\), Equals\([012]\)', re.S))
def test_mismatch_and_two_too_many_values(self):
self.assertMismatchWithDescriptionMatching(
[2, 3, 4, 5], MatchesSetwise(Equals(1), Equals(2)),
MatchesRegex(
- '.*There was 1 mismatch and 2 extra values: \[[145], [145]\]',
+ r'.*There was 1 mismatch and 2 extra values: \[[145], [145]\]',
re.S))
diff --git a/testtools/tests/test_testcase.py b/testtools/tests/test_testcase.py
index f0aa881d..1622cf8d 100644
--- a/testtools/tests/test_testcase.py
+++ b/testtools/tests/test_testcase.py
@@ -389,14 +389,14 @@ def foo():
def test_assertRaisesRegexp(self):
# assertRaisesRegexp asserts that function raises particular exception
# with particular message.
- self.assertRaisesRegexp(RuntimeError, "M\w*e", self.raiseError,
+ self.assertRaisesRegexp(RuntimeError, r"M\w*e", self.raiseError,
RuntimeError, "Message")
def test_assertRaisesRegexp_wrong_error_type(self):
# If function raises an exception of unexpected type,
# assertRaisesRegexp re-raises it.
self.assertRaises(ValueError, self.assertRaisesRegexp, RuntimeError,
- "M\w*e", self.raiseError, ValueError, "Message")
+ r"M\w*e", self.raiseError, ValueError, "Message")
def test_assertRaisesRegexp_wrong_message(self):
# If function raises an exception with unexpected message

View File

@@ -0,0 +1,170 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=testtools
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=2.3.0
pkgrel=1
pkgdesc="Extensions to the Python standard library unit testing framework (mingw-w64)"
arch=('any')
url='https://github.com/testing-cabal/testtools'
license=('MIT')
makedepends=('git'
"${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-extras"
"${MINGW_PACKAGE_PREFIX}-python2-extras"
"${MINGW_PACKAGE_PREFIX}-python3-fixtures"
"${MINGW_PACKAGE_PREFIX}-python2-fixtures"
"${MINGW_PACKAGE_PREFIX}-python3-mimeparse"
"${MINGW_PACKAGE_PREFIX}-python2-mimeparse"
"${MINGW_PACKAGE_PREFIX}-python3-pyrsistent"
"${MINGW_PACKAGE_PREFIX}-python2-pyrsistent"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-traceback2"
"${MINGW_PACKAGE_PREFIX}-python2-unittest2")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-$pkgver.tar.gz"::"https://github.com/testing-cabal/testtools/archive/$pkgver.tar.gz"
63d6945020f81d8e85aad7bafdb6bdd087d3ffbc.patch
33dc6c8c67620863d14622df49e9834ac6fe72b7.patch
0a609e10198a818ba21d607107a667cb95afef0a.patch
e83040c34dfbd908a784fe3bde9f948eee82cfc1.patch
f41ee7224121a9b74dab1c91b3fede44c9c34029.patch
fff42432c60784be1a974ffd69afb35f093c334a.patch
29004731f9c480b7c44a9c2605513d50d372898f.patch
f865cfefae73e540aedb16ebb19f813cc648f2b6.patch)
sha512sums=('7c3b9e180c5f22d613763446525fcb3f7f260d79bc875669134c3077af0e0d3e101863429e0469ffcb26fd0755b2c915454abc949be864639a2faa9cf5024c62'
'589be8461f71128eeb388a6c5813b1315a363f8b38c07d7437254fcddf12562a4a17a5b809481304e82e219848afe80c09d5fb3b5c46f40d2b66790607a7a674'
'ed961b7eefbf62755fb59c63413826cf0779bd664e5b7dd19d9319690eb3dafcec79cdad4d5d929c59bc8fc8381b64d7d882a46c872ec1da3dca7de6eaf23a0d'
'41f277d062146f8a85822ede38ca8e0dd661f10b5ed5ac47a2555be2b014415fba53917edffc1ee10d178d5098e713f98ce62250e9f9cc64df826f05839b8371'
'd58129a90857202b1d7cf03cb323a3730f083671403fc4b15c5e0b2fb605b94bae0b20d189511c16bab323cd2a5ae12a0274fffe18b723111f530f18c5622063'
'b49530ec88f5ea5ccee99dcb1e52a0dc3d97f19c8f59dac93ec1c5c8ea0d22041bcbd2d928a5198153f55e74c220dd67027b0cfcdfe9a49eda2e6ed227132993'
'11f3b6c3ef251ab4dae7e6345dc17728e153733dbab4dbdc6880670c4123b39b6e76ca7def8c984e6aa66a7e88bf5d86e1de593dac43bc35d6cd55414792fc05'
'66572c0578aa1a393ee0502b83fe3bdc38f4de039c9eea8e0aad8d19deb946c965bdd3d30d4ee2120699fadd8ea5f81a12e939a854d8b771856b871c1743a009'
'66572c0578aa1a393ee0502b83fe3bdc38f4de039c9eea8e0aad8d19deb946c965bdd3d30d4ee2120699fadd8ea5f81a12e939a854d8b771856b871c1743a009')
# 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}"
pushd "${_realname}-${pkgver}"
apply_patch_with_msg \
63d6945020f81d8e85aad7bafdb6bdd087d3ffbc.patch \
33dc6c8c67620863d14622df49e9834ac6fe72b7.patch \
0a609e10198a818ba21d607107a667cb95afef0a.patch \
e83040c34dfbd908a784fe3bde9f948eee82cfc1.patch \
f41ee7224121a9b74dab1c91b3fede44c9c34029.patch \
fff42432c60784be1a974ffd69afb35f093c334a.patch
# 29004731f9c480b7c44a9c2605513d50d372898f.patch \
apply_patch_with_msg \
f865cfefae73e540aedb16ebb19f813cc648f2b6.patch
popd
for builddir in python{2,3}-build-${CARCH}; do
rm -rf ${builddir} | true
cp -r "${_realname}-${pkgver}" "${builddir}"
done
# These are for python 2.x and old python 3.x only
sed -i 's|unittest2|unittest|' python3-build-${CARCH}/testtools/tests/test_run.py \
python3-build-${CARCH}/testtools/tests/test_testsuite.py \
python3-build-${CARCH}/testtools/tests/twistedsupport/test_matchers.py \
python3-build-${CARCH}/testtools/tests/twistedsupport/test_deferred.py \
python3-build-${CARCH}/testtools/tests/twistedsupport/test_runtest.py
sed -i '/unittest2>=1.0.0/d' python3-build-${CARCH}/requirements.txt
sed -i 's|import linecache2 as linecache|import linecache|' python3-build-${CARCH}/testtools/tests/test_compat.py
sed -i "s|traceback = try_import('traceback2')|import traceback|" python3-build-${CARCH}/testtools/content.py
sed -i '/traceback2/d' python3-build-${CARCH}/requirements.txt
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
export PBR_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} -m testtools.run testtools.tests.test_suite
done
}
package_python3-testtools() {
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-extras"
"${MINGW_PACKAGE_PREFIX}-python3-fixtures"
"${MINGW_PACKAGE_PREFIX}-python3-pyrsistent"
"${MINGW_PACKAGE_PREFIX}-python3-mimeparse")
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}/LICENSE"
}
package_python2-testtools() {
depends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-extras"
"${MINGW_PACKAGE_PREFIX}-python2-fixtures"
"${MINGW_PACKAGE_PREFIX}-python2-pyrsistent"
"${MINGW_PACKAGE_PREFIX}-python2-mimeparse"
"${MINGW_PACKAGE_PREFIX}-python2-unittest2"
"${MINGW_PACKAGE_PREFIX}-python2-traceback2")
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}/LICENSE"
}
package_mingw-w64-i686-python2-testtools() {
package_python2-testtools
}
package_mingw-w64-i686-python3-testtools() {
package_python3-testtools
}
package_mingw-w64-x86_64-python2-testtools() {
package_python2-testtools
}
package_mingw-w64-x86_64-python3-testtools() {
package_python3-testtools
}

View File

@@ -0,0 +1,37 @@
From e83040c34dfbd908a784fe3bde9f948eee82cfc1 Mon Sep 17 00:00:00 2001
From: Hugo <hugovk@users.noreply.github.com>
Date: Thu, 12 Oct 2017 22:31:59 +0300
Subject: [PATCH] Update classifiers
---
setup.cfg | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/setup.cfg b/setup.cfg
index 2ad0da56..b201b856 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -6,8 +6,23 @@ description-file = doc/overview.rst
author = Jonathan M. Lange
author-email = jml+testtools@mumak.net
classifier =
+ Development Status :: 5 - Production/Stable
+ Intended Audience :: Developers
License :: OSI Approved :: MIT License
+ Operating System :: OS Independent
+ Programming Language :: Python
+ Programming Language :: Python :: 2
+ Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.3
+ Programming Language :: Python :: 3.4
+ Programming Language :: Python :: 3.5
+ Programming Language :: Python :: 3.6
+ Programming Language :: Python :: Implementation :: CPython
+ Programming Language :: Python :: Implementation :: PyPy
+ Topic :: Software Development :: Libraries
+ Topic :: Software Development :: Libraries :: Python Modules
+ Topic :: Software Development :: Testing
[extras]
test =

View File

@@ -0,0 +1,18 @@
From f41ee7224121a9b74dab1c91b3fede44c9c34029 Mon Sep 17 00:00:00 2001
From: Hugo <hugovk@users.noreply.github.com>
Date: Tue, 9 Jan 2018 14:56:38 +0200
Subject: [PATCH] Ignore IDE metadata
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 305dc6f7..b1fafa81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,4 @@ testtools.egg-info
/.eggs/
AUTHORS
ChangeLog
+.idea

View File

@@ -0,0 +1,54 @@
From 29004731f9c480b7c44a9c2605513d50d372898f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 17 May 2018 17:52:26 +0200
Subject: [PATCH] Fix the tests on Python 3.7
Exception's repr got changed not to include trailing comma
Fixes https://github.com/testing-cabal/testtools/issues/270
---
.travis.yml | 1 +
testtools/tests/matchers/test_exception.py | 11 +++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 7f1f4db7..784608e0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,7 @@ python:
- "3.4"
- "3.5"
- "3.6"
+ - "3.7-dev"
- "pypy"
install:
diff --git a/testtools/tests/matchers/test_exception.py b/testtools/tests/matchers/test_exception.py
index 6cd80af1..acd39252 100644
--- a/testtools/tests/matchers/test_exception.py
+++ b/testtools/tests/matchers/test_exception.py
@@ -32,15 +32,22 @@ class TestMatchesExceptionInstanceInterface(TestCase, TestMatchersInterface):
matches_matches = [error_foo]
matches_mismatches = [error_bar, error_base_foo]
+ if sys.version_info >= (3, 7):
+ # exception's repr has changed
+ _e = ''
+ else:
+ _e = ','
+
str_examples = [
- ("MatchesException(Exception('foo',))",
+ ("MatchesException(Exception('foo'%s))" % _e,
MatchesException(Exception('foo')))
]
describe_examples = [
("%r is not a %r" % (Exception, ValueError),
error_base_foo,
MatchesException(ValueError("foo"))),
- ("ValueError('bar',) has different arguments to ValueError('foo',).",
+ ("ValueError('bar'%s) has different arguments to ValueError('foo'%s)."
+ % (_e, _e),
error_bar,
MatchesException(ValueError("foo"))),
]

View File

@@ -0,0 +1,145 @@
From fff42432c60784be1a974ffd69afb35f093c334a Mon Sep 17 00:00:00 2001
From: Hugo <hugovk@users.noreply.github.com>
Date: Tue, 9 Jan 2018 15:02:14 +0200
Subject: [PATCH] Drop support for EOL Python 3.3
---
.travis.yml | 3 ---
README.rst | 6 +++---
doc/hacking.rst | 2 +-
doc/overview.rst | 4 +++-
scripts/all-pythons | 2 +-
setup.cfg | 1 -
setup.py | 1 +
testtools/tests/test_testresult.py | 2 +-
8 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index f5145cb9..7f1f4db7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,7 +2,6 @@ language: python
python:
- "2.7"
- - "3.3"
- "3.4"
- "3.5"
- "3.6"
@@ -15,6 +14,4 @@ install:
script:
- python -m testtools.run testtools.tests.test_suite
- # Sphinx only supports 2.7 or >= 3.4
- - if [ ${TRAVIS_PYTHON_VERSION} = "3.3" ]; then travis_terminate 0; fi
- make clean-sphinx docs
diff --git a/README.rst b/README.rst
index 601d8baa..e46faef7 100644
--- a/README.rst
+++ b/README.rst
@@ -31,7 +31,7 @@ under the same license as Python, see LICENSE for details.
Supported platforms
-------------------
- * Python 2.7+ or 3.3+ / pypy (2.x+)
+ * Python 2.7 or 3.4+ / pypy (2.x+)
If you would like to use testtools for earlier Pythons, please use testtools
1.9.0, or for *really* old Pythons, testtools 0.9.15.
@@ -46,7 +46,7 @@ Optional Dependencies
If you would like to use our Twisted support, then you will need Twisted.
If you want to use ``fixtures`` then you can either install fixtures (e.g. from
-https://launchpad.net/python-fixtures or http://pypi.python.org/pypi/fixtures)
+https://launchpad.net/python-fixtures or https://pypi.python.org/pypi/fixtures)
or alternatively just make sure your fixture objects obey the same protocol.
@@ -54,7 +54,7 @@ Bug reports and patches
-----------------------
Please report bugs using Launchpad at <https://bugs.launchpad.net/testtools>.
-Patches should be submitted as Github pull requests, or mailed to the authors.
+Patches should be submitted as GitHub pull requests, or mailed to the authors.
See ``doc/hacking.rst`` for more details.
There's no mailing list for this project yet, however the testing-in-python
diff --git a/doc/hacking.rst b/doc/hacking.rst
index a3d9d04c..0afe29e1 100644
--- a/doc/hacking.rst
+++ b/doc/hacking.rst
@@ -15,7 +15,7 @@ Coding style
In general, follow `PEP 8`_ except where consistency with the standard
library's unittest_ module would suggest otherwise.
-testtools currently supports Python 2.7 and Python 3.3 and later.
+testtools currently supports Python 2.7 and Python 3.4 and later.
Copyright assignment
--------------------
diff --git a/doc/overview.rst b/doc/overview.rst
index 8bf79355..e9d46d60 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -92,10 +92,12 @@ Cross-Python compatibility
--------------------------
testtools gives you the very latest in unit testing technology in a way that
-will work with Python 2.7, 3.3, 3.4, 3.5, and pypy.
+will work with Python 2.7, 3.4+, and pypy.
If you wish to use testtools with Python 2.4 or 2.5, then please use testtools
0.9.15.
If you wish to use testtools with Python 2.6 or 3.2, then please use testtools
1.9.0.
+
+If you wish to use testtools with Python 3.3, then please use testtools 2.3.0.
diff --git a/scripts/all-pythons b/scripts/all-pythons
index dc0fee70..fbc36c91 100755
--- a/scripts/all-pythons
+++ b/scripts/all-pythons
@@ -89,5 +89,5 @@ def now():
if __name__ == '__main__':
sys.path.append(ROOT)
result = TestProtocolClient(sys.stdout)
- for version in '2.7 3.3 3.4 3.5 3.6'.split():
+ for version in '2.7 3.4 3.5 3.6'.split():
run_for_python(version, result, sys.argv[1:])
diff --git a/setup.cfg b/setup.cfg
index b201b856..6eb03634 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,7 +14,6 @@ classifier =
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
- Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
diff --git a/setup.py b/setup.py
index 2f4ee122..96f115cc 100755
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,7 @@
setuptools.setup(
+ python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
cmdclass=cmd_class,
setup_requires=['pbr'],
pbr=True)
diff --git a/testtools/tests/test_testresult.py b/testtools/tests/test_testresult.py
index cd96f318..de48a4b7 100644
--- a/testtools/tests/test_testresult.py
+++ b/testtools/tests/test_testresult.py
@@ -2599,7 +2599,7 @@ def test_control_characters_in_failure_string(self):
self.assertIn(self._as_output(_u("\uFFFD\uFFFD\uFFFD")), textoutput)
def _local_os_error_matcher(self):
- if sys.version_info > (3, 3):
+ if sys.version_info > (3, 4):
return MatchesAny(Contains("FileExistsError: "),
Contains("PermissionError: "))
elif os.name != "nt":

View File

@@ -0,0 +1,37 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
#
_realname=contextlib2
pkgbase=mingw-w64-python-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}"
pkgver=0.5.5
pkgrel=1
pkgdesc="contextlib2 is a backport of the standard librarys contextlib module to earlier Python versions (mingw-w64)"
arch=('any')
url="http://pypi.python.org/pypi/${_pypiname}"
license=('PSF')
depends=("${MINGW_PACKAGE_PREFIX}-python2")
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools")
source=("https://pypi.io/packages/source/${_realname:0:1}/${_realname}/${_realname}-$pkgver.tar.gz")
sha512sums=('d5c97ff8eef7d8b14da0bfdc3515f8019bcc05e24cb922ce08ca2366d5182b029d873bbf172e9e6791297df05e24f6faf40868550063dcdb54f451b14c9e505d')
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
export PBR_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}"
install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.txt"
}

View File

@@ -0,0 +1,76 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
#
_realname=linecache2
pkgbase=mingw-w64-python-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}"
pkgver=1.0.0
pkgrel=1
pkgdesc="Backports of the linecache module (mingw-w64)"
arch=('any')
url='https://github.com/testing-cabal/linecache2'
license=('PSF')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-setuptools")
options=('staticlibs' 'strip' '!debug')
source=("${_realname}-$pkgver.tar.gz"::"https://github.com/testing-cabal/linecache2/archive/$pkgver.tar.gz"
fix-syntax-error.patch)
sha256sums=('ac729083392b8cc7dd8226bd22fd71d212d15074f098f3b0937bf8b4a774d006'
'353030542b2c36c1aa182ae46025d2b099b127a5975b18d90c3a4d409563f5a9')
# 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}"
pushd "${_realname}-${pkgver}"
# patch from Debian Linux
apply_patch_with_msg fix-syntax-error.patch
popd
rm -rf python2-build-${CARCH} | true
cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
export PBR_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() {
msg "Python 2 build for ${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
${MINGW_PREFIX}/bin/python${pver} setup.py build
}
check() {
msg "Python 2 test for ${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
${MINGW_PREFIX}/bin/python2 -m unittest2 discover
}
package() {
depends=("${MINGW_PACKAGE_PREFIX}-python2")
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
}

View File

@@ -0,0 +1,26 @@
Description: Fix some Py2 syntax errors
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2015-07-08
--- python-linecache2-1.0.0.orig/linecache2/tests/inspect_fodder2.py
+++ python-linecache2-1.0.0/linecache2/tests/inspect_fodder2.py
@@ -99,15 +99,15 @@ def f():
method_in_dynamic_class = f().g
#line 101
-def keyworded(*arg1, arg2=1):
+def keyworded(arg1, arg2=1):
pass
#line 105
-def annotated(arg1: list):
+def annotated(arg1):
pass
#line 109
-def keyword_only_arg(*, arg):
+def keyword_only_arg(arg):
pass
from functools import wraps

View File

@@ -0,0 +1,74 @@
# $Id$
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=traceback2
pkgbase=mingw-w64-python-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}"
pkgver=1.4.0
pkgrel=4
pkgdesc='Backports of the traceback module (mingw-w64)'
arch=('any')
url='https://github.com/testing-cabal/traceback2'
license=('PSF')
depends=("${MINGW_PACKAGE_PREFIX}-python2-linecache2"
"${MINGW_PACKAGE_PREFIX}-python2-six")
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools"
"${MINGW_PACKAGE_PREFIX}-python2-pbr"
"${MINGW_PACKAGE_PREFIX}-python2-contextlib2")
source=("https://pypi.python.org/packages/source/t/${_realname#*-}/${_realname#*-}-${pkgver}.tar.gz")
sha512sums=('84c7fc291c8f2d4cee10441cdef1820aa453e631dfa91ed58e40fc205e97a9dd2101388d5689e4fdf10edfbf06bdb5b895d1635ae7218ba0c9b697d3f95f9342')
#source=("${_realname}-$pkgver.tar.gz"::"https://github.com/testing-cabal/traceback2/archive/$pkgver.tar.gz")
#sha256sums=('3bce822d6b97a06982938d477c5d39460e4fb7704b412e366b45371373980903')
# 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}"
rm -rf python2-build-${CARCH} | true
cp -r ${_realname#*-}-${pkgver} "python2-build-${CARCH}"
export PBR_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() {
msg "Python 2 build for ${CARCH}"
cd "${srcdir}/python2-build-${CARCH}"
${MINGW_PREFIX}/bin/python2 setup.py build
}
#check() {
# msg "Python 2 test for ${CARCH}"
# cd "${srcdir}/python2-build-${CARCH}"
# ${MINGW_PREFIX}/bin/python2 -m subunit.run discover
#}
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
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,33 @@
# HG changeset patch
# User Robert Collins <rbtcollins@hp.com>
# Date 1435721195 -43200
# Node ID 9badd4cde9ab5f70eff42777a00c038192a5541f
# Parent 4174bab908081fa41252f459dbc713246662f98b
Use traceback2 everywhere.
diff --git a/README.txt b/README.txt
--- a/README.txt
+++ b/README.txt
@@ -167,6 +167,8 @@ prevents it being fixed in unittest2.
CHANGELOG
=========
+- Use traceback2 consistently to get consistent output across all Pythons.
+
2015-06-20 - 1.1.0
------------------
diff --git a/unittest2/loader.py b/unittest2/loader.py
--- a/unittest2/loader.py
+++ b/unittest2/loader.py
@@ -3,7 +3,7 @@
import os
import re
import sys
-import traceback
+import traceback2 as traceback
import types
import unittest
import warnings

View File

@@ -0,0 +1,32 @@
Copyright (c) 2003-2010, Michael Foord
All rights reserved.
E-mail : fuzzyman AT voidspace DOT org DOT uk
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Michael Foord nor the name of Voidspace
may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,76 @@
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=unittest2
pkgbase=mingw-w64-python-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-python2-${_realname}"
pkgver=1.1.0
pkgrel=1
pkgdesc="New features in unittest for Python 2 (mingw-w64)"
url="http://www.voidspace.org.uk/python/articles/unittest2.shtml"
arch=('any')
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python2-six"
"${MINGW_PACKAGE_PREFIX}-python2-traceback2")
makedepends=("${MINGW_PACKAGE_PREFIX}-python2-setuptools")
source=(${_realname}-${pkgver}.tar.gz::https://hg.python.org/unittest2/archive/${pkgver}.tar.gz
LICENSE
9badd4cde9ab.patch
d091f0086b03.patch)
sha512sums=('ccd701194994623422d5c0bdd88d89b279cbbc67cd96b3cfee7f48e1c32f87c154a3378771e2909afa89d9c13692173ccbd692312b1ad7b9d05cf8c115fcc14b'
'85242ed21eb191fa0bab16f3e390957f1c8b7bc3b79aefbea2d925feaa8248f33d6e22afaa7d1c07c5fcb5e800910aa2a1cb52d892c104337bbdb57a380373a2'
'ed9aea429d2821b1c7448e84af8ed07127c91918d042b4b59dc80bfd23858e6698749ca97a00d4985c9d6a14056ac9bfa649135bd163668cfb0a2b63427b9e2f'
'c045a4f1f464083a2eb1917f1d7712181c862cb5a6e6d88ca836ae7259f557a53b0d6939fc59b7965701fb83a791afce7867d01b3215c2b327e83153ed09f41e')
# 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}"
pushd "${_realname}-${pkgver}"
apply_patch_with_msg 9badd4cde9ab.patch \
d091f0086b03.patch
popd
# sed -i "s/'argparse', //" ${_realname}-${pkgver}/setup.py
rm -rf python2-build-${CARCH} | true
cp -r "${_realname}-${pkgver}" "python2-build-${CARCH}"
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
export PBR_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} --skip-build -O1 --root="${pkgdir}"
install -Dm 644 "${srcdir}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${pkgname}/LICENSE"
install -Dm 644 README.txt "${pkgdir}${MINGW_PREFIX}/share/doc/${pkgname}/README"
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}/bin/|/usr/bin/env |g" -i ${_f}
done
}
# vim: ts=2 sw=2 et:

View File

@@ -0,0 +1,45 @@
# HG changeset patch
# User Robert Collins <rbtcollins@hp.com>
# Date 1435721660 -43200
# Node ID d091f0086b03f4610d41f45c8813c9402c209ccc
# Parent 9badd4cde9ab5f70eff42777a00c038192a5541f
Use PEP-426 markers to avoid installing argparse.
diff --git a/README.txt b/README.txt
--- a/README.txt
+++ b/README.txt
@@ -169,6 +169,8 @@ CHANGELOG
- Use traceback2 consistently to get consistent output across all Pythons.
+- Use PEP-426 markers to avoid installing argparse on 2.7+ Pythons.
+
2015-06-20 - 1.1.0
------------------
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -57,7 +57,7 @@ KEYWORDS = "unittest testing tests".spli
# Both install and setup requires - because we read VERSION from within the
# package, and the package also exports all the APIs.
# six for compat helpers
-REQUIRES = ['argparse', 'six>=1.4', 'traceback2'],
+REQUIRES = ['six>=1.4', 'traceback2']
params = dict(
name=NAME,
@@ -71,7 +71,10 @@ params = dict(
classifiers=CLASSIFIERS,
keywords=KEYWORDS,
install_requires=REQUIRES,
- setup_requires=REQUIRES,
+ setup_requires=['argparse'] + REQUIRES,
+ extras_require={
+ ':python_version<="2.6"': ['argparse'],
+ }
)