~alpine/aports

testing/py3-tqdm: update to 0.33.0, drop py2 v1 PROPOSED

Drew DeVault: 1
 testing/py3-tqdm: update to 0.33.0, drop py2

 4 files changed, 30 insertions(+), 129 deletions(-)
Build failed without it, maybe test related? In any case `setup.py
build` fails without py3.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/2893/mbox | git am -3
Learn more about email & git

[PATCH] testing/py3-tqdm: update to 0.33.0, drop py2 Export this patch

---
 .../0001-Import-sleep-nearer-to-usage.patch   | 25 -------
 ...y-test-that-depends-on-GNU-coreutils.patch | 32 ---------
 testing/py-tqdm/APKBUILD                      | 72 -------------------
 testing/py3-tqdm/APKBUILD                     | 30 ++++++++
 4 files changed, 30 insertions(+), 129 deletions(-)
 delete mode 100644 testing/py-tqdm/0001-Import-sleep-nearer-to-usage.patch
 delete mode 100644 testing/py-tqdm/0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch
 delete mode 100644 testing/py-tqdm/APKBUILD
 create mode 100644 testing/py3-tqdm/APKBUILD

diff --git a/testing/py-tqdm/0001-Import-sleep-nearer-to-usage.patch b/testing/py-tqdm/0001-Import-sleep-nearer-to-usage.patch
deleted file mode 100644
index 07a6e8bf5d..0000000000
--- a/testing/py-tqdm/0001-Import-sleep-nearer-to-usage.patch
@@ -1,25 +0,0 @@
From 2ee98c517b7ba4a130af7cce7677bd488fc5712d Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Fri, 22 Dec 2017 11:38:38 -0800
Subject: [PATCH] Import sleep nearer to usage

The version imported at the top is overwritten later, breaking tests.
---
 tqdm/tests/tests_tqdm.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tqdm/tests/tests_tqdm.py b/tqdm/tests/tests_tqdm.py
index d668248..ac0948b 100644
--- a/tqdm/tests/tests_tqdm.py
+++ b/tqdm/tests/tests_tqdm.py
@@ -89,6 +89,7 @@ class FakeSleep(object):
         self.dtimer = dtimer
 
     def sleep(self, t):
+        from time import sleep
         end = t + self.dtimer.t
         while self.dtimer.t < end:
             sleep(0.0000001)  # sleep a bit to interrupt (instead of pass)
--- 
2.15.0

diff --git a/testing/py-tqdm/0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch b/testing/py-tqdm/0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch
deleted file mode 100644
index 2018fa0392..0000000000
--- a/testing/py-tqdm/0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch
@@ -1,32 +0,0 @@
From 87da1f29923cf7f1af65f8b8a26c155545b61073 Mon Sep 17 00:00:00 2001
From: Drew DeVault <sir@cmpwn.com>
Date: Tue, 1 Jan 2019 20:40:05 -0500
Subject: [PATCH] Skip flaky test that depends on GNU coreutils

---
 tqdm/tests/tests_main.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tqdm/tests/tests_main.py b/tqdm/tests/tests_main.py
index 58fbbd3..3fad869 100644
--- a/tqdm/tests/tests_main.py
+++ b/tqdm/tests/tests_main.py
@@ -4,6 +4,7 @@ from os import path
 from shutil import rmtree
 from tempfile import mkdtemp
 from tqdm import main, TqdmKeyError, TqdmTypeError
+from nose.plugins.skip import SkipTest
 
 from tests_tqdm import with_setup, pretest, posttest, _range, closing, \
     UnicodeIO, StringIO
@@ -17,6 +18,7 @@ def _sh(*cmd, **kwargs):
 # WARNING: this should be the last test as it messes with sys.stdin, argv
 @with_setup(pretest, posttest)
 def test_main():
+    raise SkipTest
     """Test command line pipes"""
     ls_out = _sh('ls').replace('\r\n', '\n')
     ls = subprocess.Popen('ls', stdout=subprocess.PIPE,
--- 
2.20.1

diff --git a/testing/py-tqdm/APKBUILD b/testing/py-tqdm/APKBUILD
deleted file mode 100644
index cb9ca6bd9d..0000000000
--- a/testing/py-tqdm/APKBUILD
@@ -1,72 +0,0 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-tqdm
_pkgname=tqdm
pkgver=4.32.2
pkgrel=0
pkgdesc="Fast, Extensible Progress Meter"
url="https://pypi.python.org/pypi/tqdm"
arch="noarch"
license="MIT"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"

	case "$CARCH" in
		# FIXME: remove selected failing tests on selected arches
		aarch64) rm tqdm/tests/tests_perf.py;;
		s390x) rm tqdm/tests/tests_perf.py;;
		x86) rm tqdm/tests/tests_synchronisation.py;;
	esac
}

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"

	python2 setup.py test
	# Broken on our current Python build due to setuptools version conflict
	#python3 setup.py test
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	ln -s tqdm-3 "$pkgdir"/usr/bin/tqdm
}

_py() {
	local python="$1"
	local pyver="${python:6:1}"
	pkgdesc="$pkgdesc ($python)"
	depends="$python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"

	cd "$subpkgdir"

	# Add version suffix to executable.
	mv usr/bin/tqdm usr/bin/tqdm-$pyver
}

_py2() {
	_py python2
}

_py3() {
	_py python3
}

sha512sums="b39c0b488cef6935edc63ee73cde800678d8c3211abf74d6680274618086970a12b5bf9aaad9b6841fa2e84261d1348ceccf32c25f5a3afd8e1a1d1822f98d91  tqdm-4.32.2.tar.gz
227b39f92ef529762c455d6cb82a84f05af00a7d72b505082a749c1de959ab7814ef0b3b07df62c77ebc184671f5579718f000eaafa534b775b58427de935e96  0001-Skip-flaky-test-that-depends-on-GNU-coreutils.patch"
diff --git a/testing/py3-tqdm/APKBUILD b/testing/py3-tqdm/APKBUILD
new file mode 100644
index 0000000000..fa1e5d4151
--- /dev/null
+++ b/testing/py3-tqdm/APKBUILD
@@ -0,0 +1,30 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py3-tqdm
_pkgname=tqdm
pkgver=4.33.0
pkgrel=0
pkgdesc="Fast, Extensible Progress Meter"
url="https://pypi.python.org/pypi/tqdm"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools python3-dev"
checkdepends="py3-coverage py3-flake8 py3-nose"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check" # upstream tests are non-deterministic

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
	mv "$pkgdir"/usr/bin/tqdm "$pkgdir"/usr/bin/tqdm-3
}

sha512sums="de86a2dc2c5f887b9671ee01e7c05820375b0ef83dec92f17da4d944dd02cbf96a133fd9d349ba5f9c75af70e7b87110a9a7ad3293c7eb81e49ed6ea288ba73c  tqdm-4.33.0.tar.gz"
-- 
2.22.0