aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-factory-boy
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-04-18 12:09:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-04-18 12:09:51 +0000
commitc5aaab27f48eb15c742836df6e6ff98e17c7310a (patch)
treea55ce14f1ce71220edac793096f4a2b3e8a686ca /community/py-factory-boy
parent8087d10a60aa671bc62c282236ed37c88b64e450 (diff)
downloadaports-c5aaab27f48eb15c742836df6e6ff98e17c7310a.tar.bz2
aports-c5aaab27f48eb15c742836df6e6ff98e17c7310a.tar.xz
community/py-factory-boy: fix tests for python 3.7
Diffstat (limited to 'community/py-factory-boy')
-rw-r--r--community/py-factory-boy/APKBUILD9
-rw-r--r--community/py-factory-boy/python-3.7.patch67
2 files changed, 73 insertions, 3 deletions
diff --git a/community/py-factory-boy/APKBUILD b/community/py-factory-boy/APKBUILD
index cdfcea6732..b757522bf9 100644
--- a/community/py-factory-boy/APKBUILD
+++ b/community/py-factory-boy/APKBUILD
@@ -3,7 +3,7 @@
pkgname=py-factory-boy
_pkgname=factory_boy
pkgver=2.11.1
-pkgrel=2
+pkgrel=3
pkgdesc="A verstile test fixtures replacement based on thoughtbot's factory_girl for Ruby"
url=https://github.com/rbarrois/factory_boy
arch=noarch
@@ -15,11 +15,13 @@ 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"
+source="$pkgname-$pkgver.tar.gz::https://github.com/FactoryBoy/$_pkgname/archive/$pkgver.tar.gz
+ python-3.7.patch"
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'
@@ -68,4 +70,5 @@ _py() {
$python setup.py install --prefix=/usr --root="$subpkgdir"
}
-sha512sums="f2a0856212bb47f29007a9ec52af129c63a0546f3d4eb733ce42eb285cad4eecabfd917badb18b723e2ee653c09422328413a3eb38b1cad53e4e538a7baffbc2 py-factory-boy-2.11.1.tar.gz"
+sha512sums="f2a0856212bb47f29007a9ec52af129c63a0546f3d4eb733ce42eb285cad4eecabfd917badb18b723e2ee653c09422328413a3eb38b1cad53e4e538a7baffbc2 py-factory-boy-2.11.1.tar.gz
+6397bdd38484b8727bc88066f6da1721faa6d3717c72af54d53c62b947798e7705f74f82c3355e06dc89e2e7b32edabd0a099d80e515adb3733417c73b0eaadd python-3.7.patch"
diff --git a/community/py-factory-boy/python-3.7.patch b/community/py-factory-boy/python-3.7.patch
new file mode 100644
index 0000000000..4b1bc6836d
--- /dev/null
+++ b/community/py-factory-boy/python-3.7.patch
@@ -0,0 +1,67 @@
+From 97f48597d241aca598783f7bcaed34bf7b133343 Mon Sep 17 00:00:00 2001
+From: Jon Dufresne <jon.dufresne@gmail.com>
+Date: Tue, 28 Aug 2018 04:40:26 -0700
+Subject: [PATCH] Add testing and support for Python 3.7 and Django 2.1
+
+Python 3.7 was released on June 27, 2018.
+Django 2.1 was released on August 1, 2018.
+
+https://docs.python.org/3/whatsnew/3.7.html
+https://docs.djangoproject.com/en/2.1/releases/2.1/
+
+Fixes #492
+---
+ .travis.yml | 23 ++++++++++++++++++++---
+ README.rst | 2 +-
+ docs/changelog.rst | 3 ++-
+ factory/utils.py | 10 +++++++---
+ setup.py | 6 +++++-
+ tox.ini | 7 +++++--
+ 6 files changed, 40 insertions(+), 11 deletions(-)
+
+diff --git a/factory/utils.py b/factory/utils.py
+index 7bf38dd..15d87e4 100644
+--- a/factory/utils.py
++++ b/factory/utils.py
+@@ -73,9 +73,13 @@ def __iter__(self):
+ if self.next_elements:
+ yield self.next_elements.popleft()
+ else:
+- value = next(self.iterator)
+- self.past_elements.append(value)
+- yield value
++ try:
++ value = next(self.iterator)
++ except StopIteration:
++ break
++ else:
++ self.past_elements.append(value)
++ yield value
+
+ def reset(self):
+ self.next_elements.clear()
+diff --git a/setup.py b/setup.py
+index 4291c80..07fb60a 100755
+--- a/setup.py
++++ b/setup.py
+@@ -51,8 +51,11 @@ def get_version(package_name):
+ ],
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+- "Intended Audience :: Developers",
+ "Framework :: Django",
++ "Framework :: Django :: 1.11",
++ "Framework :: Django :: 2.0",
++ "Framework :: Django :: 2.1",
++ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python",
+@@ -62,6 +65,7 @@ def get_version(package_name):
+ "Programming Language :: Python :: 3.4",
+ "Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
++ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: Implementation :: PyPy",
+ "Topic :: Software Development :: Testing",
+ "Topic :: Software Development :: Libraries :: Python Modules",