# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=pytest pkgver=3.6.1 pkgrel=0 pkgdesc="A python test library" url="http://pytest.org" arch="noarch" license="MIT" depends="py3-$pkgname" _py2_depends="py2-py py2-six py2-attrs py2-setuptools py2-more-itertools py2-pluggy py2-funcsigs" _py3_depends="py3-py py3-six py3-attrs py3-more-itertools py3-pluggy" makedepends="python2-dev py-setuptools python3-dev $_py2_depends $_py3_depends" subpackages="py3-$pkgname:_py3 py2-$pkgname:_py2" source="https://files.pythonhosted.org/packages/source/${pkgname:0:1}/$pkgname/$pkgname-$pkgver.tar.gz" builddir="$srcdir/$pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build python3 setup.py build } check() { cd "$builddir" python2 setup.py check python3 setup.py check } package() { mkdir -p "$pkgdir"/usr/bin local name; for name in py.test pytest; do ln -s $name-3 "$pkgdir"/usr/bin/$name done } _py2() { replaces="$pkgname" depends="$_py2_depends" _py python2 } _py3() { depends="$_py3_depends" _py python3 } _py() { local python="$1" local pyver="${1:6:1}" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" # Add version suffix to executable files. local path; for path in "$subpkgdir"/usr/bin/*; do mv "$path" "$path-$pyver" done } sha512sums="38a1ccc5a915c70c66b3c9ab89e8d42a1e481ec1dfb8aa1d37b1a03d9a4fa1167e9a278a280188f30abe3ad5bb1e1a0cc74e640ae2b2d005aa3f00abc5aef957 pytest-3.6.1.tar.gz"