dev-python/txaio: Version bump
authorBrian Dolbec <dolsen@gentoo.org>
Thu, 6 Apr 2017 23:31:45 +0000 (16:31 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Tue, 16 May 2017 02:07:09 +0000 (19:07 -0700)
Update Homepage in 2.3.1, update metadata.xml.

Package-Manager: Portage-2.3.5, Repoman-2.3.2_p30

dev-python/txaio/Manifest
dev-python/txaio/files/txaio-2.7.1.chained-callback.patch [new file with mode: 0644]
dev-python/txaio/files/txaio-2.7.1.f._result.patch [new file with mode: 0644]
dev-python/txaio/metadata.xml
dev-python/txaio/txaio-2.3.1.ebuild
dev-python/txaio/txaio-2.5.1-r1.ebuild
dev-python/txaio/txaio-2.7.1.ebuild [new file with mode: 0644]

index 09ed69ee9ea21a28a432130621b46274f88ce543..89eba1b96d8fa290d1f317223615edfce7dcead1 100644 (file)
@@ -1,2 +1,3 @@
 DIST txaio-2.3.1.tar.gz 36755 SHA256 1111c87bff73e22c2067318cbb267781e2f651c485d21783b25e1e768eabab67 SHA512 019d686102c862ec308e8ffdfbca25cda1b495adef73ee8b817a465a8054a24590ab0f1e3322df92d0a528152fc5b987b98b039dcd87308e81854d3c6a9fb146 WHIRLPOOL c5f550788f669237d24c5194348a84f5e6e8ca5206bd647ff8e5dee80705809601b798c4eecca260defa69d3276c77adbee6599529b48a325ec7865902c77d89
 DIST txaio-2.5.1.tar.gz 41577 SHA256 625076477182e2dde78b79d0b2b0d6b3cecb0e24fe0ea7eaf2abd26a4c0dd1de SHA512 921b4f6738a91923cffe00eed30237e0a2a12dbd42476587b4902675d3d7d8ecbf3b6fbf47afa5648836f779f1c22f7edf9bd94d44dcacee86d03a1dd16450a5 WHIRLPOOL 24286b510c7f1911dd2a315362c76aff77bc2246164a4a1ba50573d87408db9e0e384e5063cfdbee96501b3d03decc9f4198aae9f8cd375d8c49de817d0eda63
+DIST txaio-2.7.1.tar.gz 43591 SHA256 9eea85c27ff8ac28049a29b55383f5c162351f855860e5081ff4632d65a5b4d2 SHA512 d77a8b5e8fc21be0bef43f2a6795229456a351abc1a5eb6d2b7de0da0a58e67a228cb06d1a7962efcc760099ef5df94e9421875ea5628985260911efc7deb85e WHIRLPOOL 2acff5b81fd17afd7b7d986812d742a6e09781f8f6f960ae6c08a52c6535156736492ecaca0c8026192289ab28e3cceb40e03aa4512922bc64ece7c900abd25c
diff --git a/dev-python/txaio/files/txaio-2.7.1.chained-callback.patch b/dev-python/txaio/files/txaio-2.7.1.chained-callback.patch
new file mode 100644 (file)
index 0000000..f72ccb0
--- /dev/null
@@ -0,0 +1,48 @@
+From f27f2945c8ca06e2eb0c2b95366a7a4c1363d857 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
+Date: Mon, 8 May 2017 21:20:01 +0300
+Subject: [PATCH] Removed the test for the chained callback feature
+
+---
+ test/test_callback.py | 25 -------------------------
+ 1 file changed, 25 deletions(-)
+
+diff --git a/test/test_callback.py b/test/test_callback.py
+index 08d31e3..9c8ab99 100644
+--- a/test/test_callback.py
++++ b/test/test_callback.py
+@@ -59,31 +59,6 @@ def test_callback(framework):
+     assert results[0] == "it worked"
+ 
+ 
+-def test_chained_callback(framework):
+-    """
+-    Chain two callbacks where the first one alters the value.
+-    """
+-    calls = []
+-
+-    def callback0(arg):
+-        calls.append(arg)
+-        return arg + " pray I do not alter it futher"
+-
+-    def callback1(arg):
+-        calls.append(arg)
+-
+-    f = txaio.create_future()
+-    txaio.add_callbacks(f, callback0, None)
+-    txaio.add_callbacks(f, callback1, None)
+-    txaio.resolve(f, "the deal")
+-
+-    run_once()
+-
+-    assert len(calls) == 2
+-    assert calls[0] == "the deal"
+-    assert calls[1] == "the deal pray I do not alter it futher"
+-
+-
+ def test_immediate_result(framework):
+     f = txaio.create_future_success("it worked")
+     results = []
+-- 
+2.13.0
+
diff --git a/dev-python/txaio/files/txaio-2.7.1.f._result.patch b/dev-python/txaio/files/txaio-2.7.1.f._result.patch
new file mode 100644 (file)
index 0000000..8c72b45
--- /dev/null
@@ -0,0 +1,36 @@
+From 7ecd9cbb4e7202f7c583f9080ac13db94672bc4b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
+Date: Thu, 4 May 2017 21:47:02 +0300
+Subject: [PATCH] Removed code that sets f._result
+
+This stopped working from Python 3.6 onwards, as the Future implementation is now written in C.
+---
+ txaio/aio.py | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/txaio/aio.py b/txaio/aio.py
+index 55d3ca5..becfba5 100644
+--- a/txaio/aio.py
++++ b/txaio/aio.py
+@@ -437,17 +437,12 @@ class _AsyncioApi(object):
+         """
+         callback or errback may be None, but at least one must be
+         non-None.
+-
+-        XXX beware the "f._result" hack to get "chainable-callback" type
+-        behavior.
+         """
+         def done(f):
+             try:
+                 res = f.result()
+                 if callback:
+-                    x = callback(res)
+-                    if x is not None:
+-                        f._result = x
++                    callback(res)
+             except Exception:
+                 if errback:
+                     errback(create_failure())
+-- 
+2.13.0
+
index 76992e2db5f865e1254a86044e7ae69a0295f874..ef48c740e2ee081cd4aef08a79db7f8432e9caa1 100644 (file)
@@ -5,8 +5,16 @@
                <email>python@gentoo.org</email>
                <name>Python</name>
        </maintainer>
+       <maintainer type="person">
+               <email>dolsen@gentoo.org</email>
+               <description>maintainer</description>
+       </maintainer>
        <upstream>
+               <maintainer>
+                       <email>autobahnws@googlegroups.com</email>
+                       <name>Crossbar.io Technologies GmbH</name>
+               </maintainer>
                <remote-id type="pypi">txaio</remote-id>
-               <remote-id type="github">tavendo/txaio</remote-id>
+               <remote-id type="github">crossbario/txaio</remote-id>
        </upstream>
 </pkgmetadata>
index 6895c0d2ddecbb3617798b7e4fd62a6cd41359c3..053c2fc4dfb0254572e55241bce1ca74fbec7e43 100644 (file)
@@ -9,7 +9,7 @@ RESTRICT="test"
 inherit distutils-r1
 
 DESCRIPTION="a helper library for writing code unmodified on both Twisted and asyncio"
-HOMEPAGE="https://github.com/tavendo/txaio"
+HOMEPAGE="https://github.com/crossbario/txaio"
 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
 
 LICENSE="MIT"
index 0bb36268276c5ed0c7c34e8e6d877ed1e938bd55..c59dea17c9ac2eb9b0b15e86ba7af8dbc7a7ff4a 100644 (file)
@@ -2,7 +2,10 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+# test failure with py3.6 upstream bug:
+#    https://github.com/crossbario/txaio/issues/83
+PYTHON_COMPAT=( python2_7 python3_{4,5} )
 
 inherit distutils-r1
 
diff --git a/dev-python/txaio/txaio-2.7.1.ebuild b/dev-python/txaio/txaio-2.7.1.ebuild
new file mode 100644 (file)
index 0000000..eadf412
--- /dev/null
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
+
+inherit distutils-r1
+
+DESCRIPTION="Compatibility API between asyncio/Twisted/Trollius"
+HOMEPAGE="https://github.com/crossbario/txaio https://pypi.python.org/pypi/txaio"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc test"
+
+RDEPEND="
+       $(python_gen_cond_dep '>=dev-python/trollius-2.0[${PYTHON_USEDEP}]' python2_7)
+       $(python_gen_cond_dep '>=dev-python/futures-3.0.3[${PYTHON_USEDEP}]' python2_7)
+"
+DEPEND="app-arch/unzip
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       dev-python/six[${PYTHON_USEDEP}]
+       doc? (
+               >=dev-python/sphinx-1.2.3[${PYTHON_USEDEP}]
+               >=dev-python/sphinxcontrib-spelling-2.1.2[${PYTHON_USEDEP}]
+               >=dev-python/sphinx_rtd_theme-0.1.9[${PYTHON_USEDEP}]
+               dev-python/alabaster[${PYTHON_USEDEP}]
+       )
+       test? ( >=dev-python/pytest-2.6.4[${PYTHON_USEDEP}]
+               >=dev-python/pytest-cov-1.8.1[${PYTHON_USEDEP}]
+               ~dev-python/mock-1.3.0[${PYTHON_USEDEP}]
+               >=dev-python/tox-2.1.1[${PYTHON_USEDEP}]
+               >=dev-python/pep8-1.6.2[${PYTHON_USEDEP}]
+               >=dev-python/pyenchant-1.6.6[${PYTHON_USEDEP}]
+       )
+"
+
+# py 3.6 upstream bug fixes applied just after the release
+PATCHES=(
+       "${FILESDIR}/txaio-2.7.1.f._result.patch"
+       "${FILESDIR}/txaio-2.7.1.chained-callback.patch"
+)
+
+src_prepare() {
+       default_src_prepare
+       # Take out failing tests known to pass when run manually
+       # we certainly don't need to test "python setup.py sdist" here
+       rm "${S}/test/test_packaging.py" || die
+}
+
+python_prepare() {
+       # https://github.com/tavendo/txaio/issues/3
+       cp -r "${FILESDIR}"/util.py test || die
+
+       distutils-r1_python_prepare
+}
+
+python_compile_all() {
+       use doc && emake -C docs html
+}
+
+python_test() {
+       py.test || die "Tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+       use doc && HTML_DOCS=( doc/_build/html/. )
+       distutils-r1_python_install_all
+}