Commit 2e42e90c authored by Francesco Colista's avatar Francesco Colista
Browse files

testing/pytest: added py2 and py3 package

parent 8450c9df
...@@ -3,39 +3,52 @@ ...@@ -3,39 +3,52 @@
pkgname=pytest pkgname=pytest
_pkgname=pytest _pkgname=pytest
pkgver=2.6.1 pkgver=2.6.1
pkgrel=0 pkgrel=1
pkgdesc="A python test library" pkgdesc="A python test library"
url="http://pytest.org" url="http://pytest.org"
arch="noarch" arch="noarch"
license="MIT" license="MIT"
depends="python" depends=""
depends_dev="" depends_dev=""
makedepends="python-dev py-setuptools" makedepends="python-dev py-setuptools python3-dev"
install="" install=""
subpackages="" subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
_builddir="$srcdir"/$_pkgname-$pkgver builddir="$srcdir"/$_pkgname-$pkgver
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
build() { build() {
cd "$_builddir" cd "$builddir"
python setup.py build || return 1 python setup.py build || return 1
python3 setup.py build || return 1
} }
package() { package() {
cd "$_builddir" cd "$builddir"
python setup.py install --prefix=/usr --root="$pkgdir" || return 1 python setup.py install --root=$pkgdir/ --optimize=1 || return 1
python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
} }
_py() {
local python=$1
pkgdesc="$pkgdesc - $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')
mkdir -p "$subpkgdir"${dir}
mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}
_py2() {
_py python2
replaces="$pkgname"
}
_py3() {
_py python3
}
md5sums="bb353f6cf6d9ff83ff7f2dfbeaca47a3 pytest-2.6.1.tar.gz" md5sums="bb353f6cf6d9ff83ff7f2dfbeaca47a3 pytest-2.6.1.tar.gz"
sha256sums="994dabcb3149659d259add2aa7d11bff4d35efb7cf4c8233fa9b0b62c1255c3c pytest-2.6.1.tar.gz" sha256sums="994dabcb3149659d259add2aa7d11bff4d35efb7cf4c8233fa9b0b62c1255c3c pytest-2.6.1.tar.gz"
sha512sums="1bfbe27491800943484616a37cfe0f2f8677e3b2a25aee19f842bdf66a9c0205af8c2aecaeb50823970ab9f7042b1bb9115e3c4d689fe568a17a062c50ead829 pytest-2.6.1.tar.gz" sha512sums="1bfbe27491800943484616a37cfe0f2f8677e3b2a25aee19f842bdf66a9c0205af8c2aecaeb50823970ab9f7042b1bb9115e3c4d689fe568a17a062c50ead829 pytest-2.6.1.tar.gz"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment