Mail archive
alpine-aports

[alpine-aports] [PATCH v3 04/10] py-dateutil: adopt, upgrade to 2.8.0

From: Drew DeVault <sir_at_cmpwn.com>
Date: Wed, 3 Apr 2019 16:16:36 -0400

---
 main/py-dateutil/APKBUILD | 61 +++++++++++++++++++++++++--------------
 1 file changed, 39 insertions(+), 22 deletions(-)
diff --git a/main/py-dateutil/APKBUILD b/main/py-dateutil/APKBUILD
index 813966756b..d56419baf3 100644
--- a/main/py-dateutil/APKBUILD
+++ b/main/py-dateutil/APKBUILD
_at_@ -1,23 +1,41 @@
-# Contributor: 
-# Maintainer: 
+# Maintainer: Drew DeVault <sir_at_cmpwn.com>
 pkgname=py-dateutil
-_pkgname=python-dateutil
-pkgver=2.7.3
+_pyname=python-dateutil
+pkgver=2.8.0
 pkgrel=0
 pkgdesc="Python extensions for datetime module"
 url="https://dateutil.readthedocs.io"
 arch="noarch"
-license="BSD"
-depends="py-six"
-makedepends="python2-dev python3-dev py-setuptools"
+license="Apache-2.0"
+_py2_deps="py2-six"
+_py3_deps="py3-six"
+makedepends="
+	$_py2_deps $_py3_deps python2-dev python3-dev py2-setuptools py3-setuptools
+"
+checkdepends="
+	pytest py3-pytest py2-hypothesis py3-hypothesis py2-freezegun py3-freezegun
+"
 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
-source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-builddir="$srcdir/$_pkgname-$pkgver"
+_pypiprefix="${_pyname%${_pyname#?}}"
+source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
+builddir="$srcdir/$_pyname-$pkgver"
+
+prepare() {
+	cp -r "$builddir" "$builddir"-py2
+}
 
 build() {
 	cd "$builddir"
-	python2 setup.py build || return 1
-	python3 setup.py build || return 1
+	python3 setup.py build
+	cd "$builddir"-py2
+	python2 setup.py build
+}
+
+check() {
+	cd "$builddir"
+	pytest-3
+	cd "$builddir"-py2
+	pytest-2
 }
 
 package() {
_at_@ -25,24 +43,23 @@ package() {
 }
 
 _py2() {
-	replaces="$pkgname"
-	depends="${depends//py-/py2-}"
+	depends="$_py2_deps"
+	cd "$builddir"-py2
 	_py python2
 }
 
 _py3() {
-	depends="${depends//py-/py3-}"
+	depends="$_py3_deps"
+	cd "$builddir"
 	_py python3
 }
 
 _py() {
-	local python="$1"
-	pkgdesc="$pkgdesc (for $python)"
-	depends="$depends $python"
-	install_if="$pkgname=$pkgver-r$pkgrel $python"
-
-	cd "$builddir"
-	$python setup.py install --prefix=/usr --root="$subpkgdir"
+	_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="6b9973fa7db69d931bc6e772201c67bb7bbfa693ba35484d34960bd7e6227f2a2343df814a9fdbbff253e750299c48e7cdb2a609bf4522595df8a7fc595784fd  python-dateutil-2.7.3.tar.gz"
+sha512sums="ec7da86203572582f883a4686acf8a732a2de4f396d809057eb51b2c60dbca5623a7fa90c2c0618c281a2282c60841739bd837731a51cc876f4ff369297f2f81  python-dateutil-2.8.0.tar.gz"
-- 
2.21.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed Apr 03 2019 - 16:16:36 UTC