desktop/python-tox/PKGBUILD

66 lines
1.7 KiB
Bash

pkgbase=python-tox
pkgname=(python3-tox python2-tox)
pkgver=2.9.1
pkgrel=2
pkgdesc='Python virtualenv management and testing tool'
arch=('any')
url='https://tox.readthedocs.io'
license=('GPL2')
makedepends=('python3-setuptools' 'python2-setuptools' 'python3-py' 'python2-py' 'python3-virtualenv'
'python2-virtualenv' 'python3-pluggy' 'python2-pluggy')
checkdepends=('python3-pytest-runner' 'python2-pytest-runner')
source=("https://pypi.io/packages/source/t/tox/tox-$pkgver.tar.gz")
sha512sums=('ff19b2bb7ac963379f1cccd4973ad9eb4dabfbda976cde7caba50ad010d8fa57c1cba91d63e3e0512e44cc7d350bc9270fbd9b30db1bd55f7d9c239e7623d066')
prepare() {
find tox-$pkgver -name "*.pyc" -delete
cp -a tox-$pkgver{,-py2}
}
build() {
cd "$srcdir"/tox-$pkgver
python3 setup.py build
cd "$srcdir"/tox-$pkgver-py2
python2 setup.py build
}
check() {
# Hack entry points
(
cd "$srcdir"/tox-$pkgver
virtualenv3 "$srcdir/pyvenv" --system-site-packages
. "$srcdir/pyvenv/bin/activate"
python setup.py install
python setup.py pytest
)
(
cd "$srcdir"/tox-$pkgver-py2
virtualenv2 "$srcdir/pyvenv-py2" --system-site-packages
. "$srcdir/pyvenv-py2/bin/activate"
python setup.py install
python setup.py pytest
)
}
package_python3-tox() {
depends=('python3-py' 'python3-virtualenv' 'python3-setuptools' 'python3-pluggy')
cd "$srcdir"/tox-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
ln -s tox "$pkgdir"/usr/bin/tox3
}
package_python2-tox() {
depends=('python2-py' 'python2-virtualenv' 'python2-setuptools' 'python2-pluggy')
cd "$srcdir"/tox-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
mv "$pkgdir"/usr/bin/tox{,2}
mv "$pkgdir"/usr/bin/{tox-quickstart,tox2-quickstart}
}