aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-06 14:01:28 -0700
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2019-03-18 17:45:51 +0200
commitb67707fe0c411db1ff727da381e8376e9e6aeeba (patch)
tree8a3834d3a013904213c79cb47353bd962021682d
parent92babc311252c4c60617455f138517436dc0903b (diff)
downloadaports-b67707fe0c411db1ff727da381e8376e9e6aeeba.tar.bz2
aports-b67707fe0c411db1ff727da381e8376e9e6aeeba.tar.xz
main/py-factory-boy: fix depends
Also modernizes the APKBUILD
-rw-r--r--main/py-factory-boy/APKBUILD67
1 files changed, 50 insertions, 17 deletions
diff --git a/main/py-factory-boy/APKBUILD b/main/py-factory-boy/APKBUILD
index cb810161b2..24b0876c58 100644
--- a/main/py-factory-boy/APKBUILD
+++ b/main/py-factory-boy/APKBUILD
@@ -1,35 +1,68 @@
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
pkgname=py-factory-boy
+_pkgname=factory_boy
pkgver=2.11.1
-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
license=MIT
-depends=
-makedepends=py-setuptools
-source="https://files.pythonhosted.org/packages/source/f/factory_boy/factory_boy-$pkgver.tar.gz"
+depends="py-faker py-six"
+makedepends="py-setuptools"
+checkdepends="py-mock py-django py-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/factory_boy-$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
+ cd "$builddir"
+ # 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"
- ./setup.py 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() {
- cd "$_builddir"
- ./setup.py install --root "$pkgdir"
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="py-factory-boy"
+ depends="py-six"
+ cd "$builddir"
+ _py python2
+}
+
+_py3() {
+ 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="6c1b6c759d2a68ff4142241f7f26cd1a79b68d31f7e27b4772a242d9cefe79a3bdad35c6bdf1f6446815cd16d6b62c775262a4b75d76217a9152cca7677b6157 factory_boy-2.11.1.tar.gz"
+sha512sums="f2a0856212bb47f29007a9ec52af129c63a0546f3d4eb733ce42eb285cad4eecabfd917badb18b723e2ee653c09422328413a3eb38b1cad53e4e538a7baffbc2 py-factory-boy-2.11.1.tar.gz"