diff options
author | Leo <thinkabit.ukim@gmail.com> | 2019-08-29 02:11:22 -0300 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2019-09-03 17:44:34 -0300 |
commit | 809cccc33c60a9b102daf83597560f15c83fc4a4 (patch) | |
tree | b55604722bcdb86706853410b8a047f2355da4cd /community/py3-factory-boy | |
parent | d084b84863e6d5ab4b3dedd4157d725ceee8bf35 (diff) | |
download | aports-809cccc33c60a9b102daf83597560f15c83fc4a4.tar.bz2 aports-809cccc33c60a9b102daf83597560f15c83fc4a4.tar.xz |
community/py3-factory-boy: rename from py-factory-boy
Diffstat (limited to 'community/py3-factory-boy')
-rw-r--r-- | community/py3-factory-boy/APKBUILD | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/community/py3-factory-boy/APKBUILD b/community/py3-factory-boy/APKBUILD new file mode 100644 index 0000000000..ac473ebb38 --- /dev/null +++ b/community/py3-factory-boy/APKBUILD @@ -0,0 +1,72 @@ +# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> +# Maintainer: Drew DeVault <sir@cmpwn.com> +pkgname=py-factory-boy +_pkgname=factory_boy +pkgver=2.12.0 +pkgrel=0 +pkgdesc="A verstile test fixtures replacement based on thoughtbot's factory_girl for Ruby" +url=https://github.com/rbarrois/factory_boy +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" +checkdepends=" + py2-mock py3-mock py2-django py3-django py2-sqlalchemy 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 + +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" +} + +_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" |