desktop/python-mock/PKGBUILD

52 lines
1.6 KiB
Bash
Raw Normal View History

2014-05-13 07:52:10 +08:00
# Maintainer: Manuel 'UtG' <utg.chakra.linux[at]gmail[dot]com>
pkgbase=python-mock
pkgname=(python2-mock python3-mock)
2017-10-29 02:02:10 +08:00
pkgver=2.0.0
pkgrel=1
2014-05-13 07:52:10 +08:00
pkgdesc='Mocking and Patching Library for Testing'
url='http://www.voidspace.org.uk/python/mock/'
makedepends=('python3-setuptools' 'python2-setuptools')
2017-10-29 02:02:10 +08:00
checkdepends=('python3-nose' 'python2-nose' 'python3-pbr' 'python2-pbr' 'python3-six' 'python2-six' 'git')
2014-05-13 07:52:10 +08:00
license=('BSD')
2014-09-07 02:06:09 +08:00
arch=('any')
2017-10-29 02:02:10 +08:00
source=("https://pypi.python.org/packages/0c/53/014354fc93c591ccc4abff12c473ad565a2eb24dcd82490fae33dbf2539f/mock-2.0.0.tar.gz")
md5sums=('0febfafd14330c9dcaa40de2d82d40ad')
2014-05-13 07:52:10 +08:00
build() {
cd "$srcdir"
cp -rf "mock-$pkgver" "mock2-$pkgver"
cd "$srcdir/mock-$pkgver"
python3 setup.py build
cd "$srcdir/mock2-$pkgver"
python2 setup.py build
}
check() {
cd "$srcdir/mock2-$pkgver/"
sed -i 's/unittest2/unittest/g' mock/tests/*.py
echo 'python tests'
python3 -m unittest discover
# Does not run because of self.assertRaisesRegex() usage in unitests, which is self.assertRaisesRegexp() in Python 2.7
#echo 'python2 tests'
#python2 -m unittest discover
}
2014-05-13 07:52:10 +08:00
package_python3-mock() {
depends=('python3' 'python3-six' 'python3-pbr')
2014-05-13 07:52:10 +08:00
cd "$srcdir/mock-$pkgver"
python3 setup.py install --optimize=1 --root="$pkgdir"
install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
package_python2-mock() {
depends=('python2' 'python2-six' 'python2-pbr' 'python2-funcsigs')
2014-05-13 07:52:10 +08:00
cd "$srcdir/mock2-$pkgver"
python2 setup.py install --optimize=1 --root="$pkgdir"
install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}