mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-06 04:46:42 +02:00
community/py3-factory-boy: drop py2
This commit is contained in:
parent
809cccc33c
commit
d4234f0e13
@ -1,72 +1,43 @@
|
||||
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
|
||||
# Maintainer: Drew DeVault <sir@cmpwn.com>
|
||||
pkgname=py-factory-boy
|
||||
pkgname=py3-factory-boy
|
||||
_pkgname=factory_boy
|
||||
pkgver=2.12.0
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
pkgdesc="A verstile test fixtures replacement based on thoughtbot's factory_girl for Ruby"
|
||||
url=https://github.com/rbarrois/factory_boy
|
||||
arch=noarch
|
||||
arch="noarch"
|
||||
license=MIT
|
||||
_py2_deps="py2-faker py2-six"
|
||||
_py2_deps="py3-faker py3-six"
|
||||
makedepends="$_py2_deps $_py3_deps py2-setuptools py3-setuptools"
|
||||
depends="python3 py3-faker py3-six"
|
||||
makedepends="py3-setuptools"
|
||||
checkdepends="
|
||||
py2-mock py3-mock py2-django py3-django py2-sqlalchemy py3-sqlalchemy
|
||||
py3-mock py3-django py3-sqlalchemy
|
||||
"
|
||||
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
|
||||
source="$pkgname-$pkgver.tar.gz::https://github.com/FactoryBoy/$_pkgname/archive/$pkgver.tar.gz"
|
||||
builddir=$srcdir/$_pkgname-$pkgver
|
||||
builddir="$srcdir/$_pkgname-$pkgver"
|
||||
|
||||
replaces="py-factory-boy" # Backwards compatibility
|
||||
provides="py-factory-boy=$pkgver-r$pkgrel" # Backwards compatibility
|
||||
|
||||
prepare() {
|
||||
cd "$builddir"
|
||||
default_prepare
|
||||
# mongodb is not supported by Alpine Linux
|
||||
rm factory/mongoengine.py
|
||||
sed -i factory/__init__.py -e 's/from . import mongoengine//g'
|
||||
rm tests/test_mongoengine.py
|
||||
sed -i tests/__init__.py -e 's/from .test_mongoengine.*//g'
|
||||
cp -r "$builddir" "$builddir"-py3
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
python2 setup.py build
|
||||
cd "$builddir"-py3
|
||||
python3 setup.py build
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$builddir"
|
||||
# sqlalchemy deprecation test fails on Python 2; benign failure
|
||||
#python2 setup.py test
|
||||
cd "$builddir"-py3
|
||||
python3 setup.py test
|
||||
}
|
||||
|
||||
package() {
|
||||
mkdir -p "$pkgdir"
|
||||
python3 setup.py install --prefix=/usr --root="$pkgdir"
|
||||
}
|
||||
|
||||
_py2() {
|
||||
replaces="py-factory-boy"
|
||||
depends="$_py2_deps"
|
||||
cd "$builddir"
|
||||
_py python2
|
||||
}
|
||||
|
||||
_py3() {
|
||||
depends="$_py3_deps"
|
||||
cd "$builddir"-py3
|
||||
_py python3
|
||||
}
|
||||
|
||||
_py() {
|
||||
python="$1"
|
||||
pkgdesc="$pkgdesc (for $python)"
|
||||
depends="$depends $python"
|
||||
install_if="$pkgname=$pkgver-r$pkgrel $python"
|
||||
$python setup.py install --prefix=/usr --root="$subpkgdir"
|
||||
}
|
||||
|
||||
sha512sums="33236bc02d5331998bb210af498bea46fc9540e66af32db8fdab563193b7ae8870e7cc01c93c24a03ee23ba64bac6ca27a72bb51a264d1c7b6bf9b098c65d5d2 py-factory-boy-2.12.0.tar.gz"
|
||||
sha512sums="33236bc02d5331998bb210af498bea46fc9540e66af32db8fdab563193b7ae8870e7cc01c93c24a03ee23ba64bac6ca27a72bb51a264d1c7b6bf9b098c65d5d2 py3-factory-boy-2.12.0.tar.gz"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user