blob: 24b0876c583c5328907a9e48b581a183bb0b4f79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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=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="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
prepare() {
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"
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="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="f2a0856212bb47f29007a9ec52af129c63a0546f3d4eb733ce42eb285cad4eecabfd917badb18b723e2ee653c09422328413a3eb38b1cad53e4e538a7baffbc2 py-factory-boy-2.11.1.tar.gz"
|