author | Felix Yan
<felixonmars@archlinux.org> 2015-11-07 06:36:01 UTC |
committer | Felix Yan
<felixonmars@archlinux.org> 2015-11-07 06:36:01 UTC |
parent | d58332287c2d6db54a0dc76c4a4cb7dfb9b735ad |
0001-use_system_ca_certificates.patch | +3 | -3 |
0002-get-rid-of-backports-ssl-match-hostname.patch | +5 | -5 |
0003-support-monotonic.patch | +52 | -0 |
PKGBUILD | +31 | -23 |
diff --git a/0001-use_system_ca_certificates.patch b/0001-use_system_ca_certificates.patch index 823826b..84d0c10 100644 --- a/0001-use_system_ca_certificates.patch +++ b/0001-use_system_ca_certificates.patch @@ -8,9 +8,9 @@ index f09169f..d42c486 100644 # until we have more declarative metadata. - install_requires.append('certifi') + pass - kwargs['install_requires'] = install_requires - - setup( + if sys.version_info < (3, 5): + install_requires.append('backports_abc>=0.4') + kwargs['install_requires'] = install_requires diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index f0f73fa..ffe3e40 100644 --- a/tornado/simple_httpclient.py diff --git a/0002-get-rid-of-backports-ssl-match-hostname.patch b/0002-get-rid-of-backports-ssl-match-hostname.patch index d88c123..a0fbd73 100644 --- a/0002-get-rid-of-backports-ssl-match-hostname.patch +++ b/0002-get-rid-of-backports-ssl-match-hostname.patch @@ -13,11 +13,11 @@ index f09169f..f795807 100644 --- a/setup.py +++ b/setup.py @@ -121,7 +121,7 @@ def build_extension(self, ext): - if setuptools is not None: - # If setuptools is not available, you're on your own for dependencies. - install_requires = [] + if sys.version_info < (2, 7): + # Only needed indirectly, for singledispatch. + install_requires.append('ordereddict') - if sys.version_info < (3, 2): + if sys.version_info < (2, 7, 9) or (3, 0) <= sys.version_info < (3, 2): install_requires.append('backports.ssl_match_hostname') - kwargs['install_requires'] = install_requires - + if sys.version_info < (3, 4): + install_requires.append('singledispatch') \ No newline at end of file diff --git a/0003-support-monotonic.patch b/0003-support-monotonic.patch new file mode 100644 index 0000000..28ed4a1 --- /dev/null +++ b/0003-support-monotonic.patch @@ -0,0 +1,52 @@ +commit 7861716d2315606b03c4126505d6b158640218aa +Author: Felix Yan <felixonmars@archlinux.org> +Date: Sat Nov 7 13:53:09 2015 +0800 + + Add monotonic as an alternative to Monotime + +diff --git a/docs/index.rst b/docs/index.rst +index e4a4d80..14f9af6 100644 +--- a/docs/index.rst ++++ b/docs/index.rst +@@ -100,6 +100,8 @@ the following optional packages may be useful: + * `Monotime <https://pypi.python.org/pypi/Monotime>`_ adds support for + a monotonic clock, which improves reliability in environments + where clock adjustments are frequent. No longer needed in Python 3.3. ++* `monotonic <https://pypi.python.org/pypi/monotonic>`_ adds support for ++ a monotonic clock. Alternative to Monotime. No longer needed in Python 3.3. + + **Platforms**: Tornado should run on any Unix-like platform, although + for the best performance and scalability only Linux (with ``epoll``) +diff --git a/tornado/platform/auto.py b/tornado/platform/auto.py +index fc40c9d..449b634 100644 +--- a/tornado/platform/auto.py ++++ b/tornado/platform/auto.py +@@ -47,8 +47,13 @@ try: + except ImportError: + pass + try: +- from time import monotonic as monotonic_time ++ # monotonic can provide a monotonic function in versions of python before ++ # 3.3, too. ++ from monotonic import monotonic as monotonic_time + except ImportError: +- monotonic_time = None ++ try: ++ from time import monotonic as monotonic_time ++ except ImportError: ++ monotonic_time = None + + __all__ = ['Waker', 'set_close_exec', 'monotonic_time'] +diff --git a/tox.ini b/tox.ini +index 82b156d..6f74a74 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -85,7 +85,7 @@ deps = + {py2,py27,pypy,py3,py33}-full: singledispatch + py33-asyncio: asyncio + trollius: trollius +- py2-monotonic: Monotime ++ py2-monotonic: monotonic + sphinx: sphinx + sphinx: sphinx_rtd_theme + diff --git a/PKGBUILD b/PKGBUILD index ac518a3..5ca9964 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,31 +2,38 @@ # Contributor: Thomas Dziedzic < gostrc at gmail > pkgname=('python-tornado' 'python2-tornado') -pkgver=4.2.1 -pkgrel=3 +pkgver=4.3.0 +pkgrel=1 pkgdesc='open source version of the scalable, non-blocking web server and tools' arch=('i686' 'x86_64') url='http://www.tornadoweb.org/' license=('Apache') makedepends=('python-setuptools' 'python2-setuptools' 'git') -checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' 'python2-twisted' 'python2-futures' 'python2-singledispatch') -source=("git+https://github.com/facebook/tornado.git#tag=v$pkgver" +checkdepends=('python-pycurl' 'python2-pycurl' 'python-mock' 'python2-mock' 'python-twisted' + 'python2-twisted' 'python2-futures' 'python2-singledispatch' 'python2-backports-abc' + 'python2-trollius' 'python2-monotonic') +source=("git+https://github.com/tornadoweb/tornado.git#tag=v$pkgver" 0001-use_system_ca_certificates.patch - 0002-get-rid-of-backports-ssl-match-hostname.patch) + 0002-get-rid-of-backports-ssl-match-hostname.patch + 0003-support-monotonic.patch) sha512sums=('SKIP' - '7d484e811c7de62d2f2d38595abc5edf8f6cbdfc8a983229d4ad6b67cadf00f101acaee88bfa4337b14b5a234ebaacc72036ccafca3596eac5f64298a1e30d54' - '798f1c5f659138aa4d775edde7c962ec6410671f528b7ec44ca12ac342ddf9ec51d998c676b9025292a58c2140ba8492fcc76759b63adaf08320f96b11bcbfea') + 'cf3dbed20b0bb78cdaa16d4141adc7e12e0b5fd339d2ee9edb5d618dd1c87a643b6ecee19455235b1df712154ce83a1f4149c5579a5a1df5bdf2cd865c766b66' + '4a1a3e83214c9243ac7bd7ca141b25a41279ee25ed1400f7b25259329c52c7c625a8b5724d60b83af170643ae7258fd56f42e2d19c85929d77378f70a4d2205a' + '4dc30c12a6b454a517ee19ca84f71d1733d41b089399102827c0c9e629b26fec415df9eaf6b43ecbe495cbb5b7b938d5f157c8cb617e9daceff3c15739b7f647') prepare() { cd tornado patch -p1 -i ../0001-use_system_ca_certificates.patch patch -p1 -i ../0002-get-rid-of-backports-ssl-match-hostname.patch + patch -p1 -i ../0003-support-monotonic.patch cd "$srcdir" cp -a tornado{,-py2} # python -> python2 rename find tornado-py2 -name '*py' -exec sed -e 's_#!/usr/bin/env python_&2_' -i {} \; + + export TORNADO_EXTENSION=1 } build() { @@ -40,29 +47,31 @@ build() { check() { ( cd tornado - # TODO: exporting PYTHONPATH didn't fix the tornado.speedups not found problem... - export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-3.5:$PYTHONPATH" + python setup.py install --root="$PWD/tmp_install" --optimize=1 + export PYTHONPATH="$PWD/tmp_install/usr/lib/python3.5/site-packages:$PYTHONPATH" + cd tmp_install python -m tornado.test.runtests - python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient - # python -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver # pycares not in the repos - python -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver - python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop python -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop + python -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient + python -m tornado.test.runtests --ioloop_time_monotonic python -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop - python -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver - ) || warning "Python 3 tests failed" + python -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop + python -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver + ) ( cd tornado-py2 - export PYTHONPATH="$(pwd)/build/lib.linux-$CARCH-2.7:$PYTHONPATH" + python2 setup.py install --root="$PWD/tmp_install" --optimize=1 + export PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH" + cd tmp_install python2 -m tornado.test.runtests - python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient - # python2 -m tornado.test.runtests --resolver=tornado.platform.caresresolver.CaresResolver # pycares not in the repos - python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver python2 -m tornado.test.runtests --ioloop=tornado.platform.select.SelectIOLoop + python2 -m tornado.test.runtests --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient + python2 -m tornado.test.runtests --ioloop_time_monotonic python2 -m tornado.test.runtests --ioloop=tornado.platform.twisted.TwistedIOLoop - python2 -m tornado.test.runtests --ioloop=tornado.test.twisted_test.LayeredTwistedIOLoop --resolver=tornado.platform.twisted.TwistedResolver - ) || warning "Python 2 tests failed" + python2 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop + python2 -m tornado.test.runtests --resolver=tornado.netutil.ThreadedResolver + ) } package_python-tornado() { @@ -73,9 +82,8 @@ package_python-tornado() { } package_python2-tornado() { - depends=('python2>=2.7.9') + depends=('python2-singledispatch' 'python2-backports-abc') cd tornado-py2 python2 setup.py install --root="${pkgdir}" --optimize=1 } -