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

Message ID 20190403201642.14637-4-sir@cmpwn.com
State New
Headers show
Series
  • [alpine-aports,v3,01/10] community/py-factory-boy: adopt APKBUILD
Related show

Commit Message

Drew DeVault April 3, 2019, 8:16 p.m. UTC
---
 main/py-dateutil/APKBUILD | 61 +++++++++++++++++++++++++--------------
 1 file changed, 39 insertions(+), 22 deletions(-)

Comments

Natanael Copa April 4, 2019, 11:47 a.m. UTC | #1
On Wed,  3 Apr 2019 16:16:36 -0400
Drew DeVault <sir@cmpwn.com> wrote:

> ---
>  main/py-dateutil/APKBUILD | 61 +++++++++++++++++++++++++--------------
>  1 file changed, 39 insertions(+), 22 deletions(-)

I'm gonna merge this to my python 3.7 rebuild with a slightly modified
commit message. I'm gonna add "main/".

Thanks!

-nc


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa April 4, 2019, 12:12 p.m. UTC | #2
On Wed,  3 Apr 2019 16:16:36 -0400
Drew DeVault <sir@cmpwn.com> wrote:

> ---
>  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
> @@ -1,23 +1,41 @@
> -# Contributor: 
> -# Maintainer: 
> +# Maintainer: Drew DeVault <sir@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
> +"

Adding py-freezegun introduces a circular dependency, as freezegun
depends on dateutil.

We dont really have any good strategy yet how to deal with packages
needing bootstrap. We could have things like stage1_makdepends,
stage1_checkdepends or similar, and then rebuild all packages with
stage1_* set as a second stage.

But this is a can of worms, so I think for now we should keep things
simple and just disable tests. At least til after 3.10 release.

-nc


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

Patch

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
@@ -1,23 +1,41 @@ 
-# Contributor: 
-# Maintainer: 
+# Maintainer: Drew DeVault <sir@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() {
@@ -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"