Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Asaf Kahlon <asafka7@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 22/23] python-twisted: bump to version 18.7.0
Date: Wed, 26 Sep 2018 18:35:04 +0300	[thread overview]
Message-ID: <20180926153505.3411-23-asafka7@gmail.com> (raw)
In-Reply-To: <20180926153505.3411-1-asafka7@gmail.com>

Add license hash.

Add a patch to fit python3.7 syntax ("async" is now a keyword).
The patch was already applied on upstream, but only after the last tag
was created.

Fixes:
http://autobuild.buildroot.org/results/704/7043ccfac86439406480649b3ead4882112d36e2/

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 .../0001-Fix-syntax-for-python3.7.patch       | 160 ++++++++++++++++++
 package/python-twisted/Config.in              |   2 +
 package/python-twisted/python-twisted.hash    |   8 +-
 package/python-twisted/python-twisted.mk      |   4 +-
 4 files changed, 169 insertions(+), 5 deletions(-)
 create mode 100644 package/python-twisted/0001-Fix-syntax-for-python3.7.patch

diff --git a/package/python-twisted/0001-Fix-syntax-for-python3.7.patch b/package/python-twisted/0001-Fix-syntax-for-python3.7.patch
new file mode 100644
index 0000000000..a55695c764
--- /dev/null
+++ b/package/python-twisted/0001-Fix-syntax-for-python3.7.patch
@@ -0,0 +1,160 @@
+From ef2bd5d0c0ca66aae16bf1344dfb18d52a6f5c74 Mon Sep 17 00:00:00 2001
+From: Asaf Kahlon <asafka7@gmail.com>
+Date: Wed, 26 Sep 2018 17:47:02 +0300
+Subject: [PATCH 1/1] Fix syntax for python3.7
+
+Based on upstream patch (dcaf946217b4ea1684e98a9ebc4f9925d76f3108)
+to solve python3.7 syntax error with "async" keyword.
+
+Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
+---
+ src/twisted/conch/manhole.py | 15 ++++++++-------
+ src/twisted/mail/imap4.py    | 19 +++++++++++--------
+ src/twisted/python/compat.py | 24 ++++++++++++++++++++++++
+ 3 files changed, 43 insertions(+), 15 deletions(-)
+
+diff --git a/src/twisted/conch/manhole.py b/src/twisted/conch/manhole.py
+index 3326f90aa..17ca05c58 100644
+--- a/src/twisted/conch/manhole.py
++++ b/src/twisted/conch/manhole.py
+@@ -19,7 +19,7 @@ from io import BytesIO
+ from twisted.conch import recvline
+ 
+ from twisted.internet import defer
+-from twisted.python.compat import _tokenize
++from twisted.python.compat import _tokenize, get_async_param
+ from twisted.python.htmlizer import TokenPrinter
+ 
+ class FileWrapper:
+@@ -151,9 +151,9 @@ class ManholeInterpreter(code.InteractiveInterpreter):
+         return failure
+ 
+ 
+-    def write(self, data, async=False):
+-        self.handler.addOutput(data, async)
+-
++    def write(self, data, async_=None, **kwargs):
++        async_ = get_async_param(async_, **kwargs)
++        self.handler.addOutput(data, async_)
+ 
+ 
+ CTRL_C = b'\x03'
+@@ -237,14 +237,15 @@ class Manhole(recvline.HistoricRecvLine):
+         return not w.endswith(b'\n') and not w.endswith(b'\x1bE')
+ 
+ 
+-    def addOutput(self, data, async=False):
+-        if async:
++    def addOutput(self, data, async_=None, **kwargs):
++        async_ = get_async_param(async_, **kwargs)
++        if async_:
+             self.terminal.eraseLine()
+             self.terminal.cursorBackward(len(self.lineBuffer) + len(self.ps[self.pn]))
+ 
+         self.terminal.write(data)
+ 
+-        if async:
++        if async_:
+             if self._needsNewline():
+                 self.terminal.nextLine()
+ 
+diff --git a/src/twisted/mail/imap4.py b/src/twisted/mail/imap4.py
+index 0ca1f1c5e..295053a6c 100644
+--- a/src/twisted/mail/imap4.py
++++ b/src/twisted/mail/imap4.py
+@@ -42,7 +42,7 @@ from twisted.python.compat import (
+     _bytesChr, unichr as chr, _b64decodebytes as decodebytes,
+     _b64encodebytes as encodebytes,
+     intToBytes, iterbytes, long, nativeString, networkString, unicode,
+-    _matchingString, _PY3
++    _matchingString, _PY3, get_async_param,
+ )
+ from twisted.internet import interfaces
+ 
+@@ -1090,8 +1090,9 @@ class IMAP4Server(basic.LineReceiver, policies.TimeoutMixin):
+         self._respond(b'NO', tag, message)
+ 
+ 
+-    def sendUntaggedResponse(self, message, async=False):
+-        if not async or (self.blocked is None):
++    def sendUntaggedResponse(self, message, async_=None, **kwargs):
++        async_ = get_async_param(async_, **kwargs)
++        if not async_ or (self.blocked is None):
+             self._respond(message, None, None)
+         else:
+             self._queuedAsync.append(message)
+@@ -2497,9 +2498,9 @@ class IMAP4Server(basic.LineReceiver, policies.TimeoutMixin):
+     #
+     def modeChanged(self, writeable):
+         if writeable:
+-            self.sendUntaggedResponse(message=b'[READ-WRITE]', async=True)
++            self.sendUntaggedResponse(message=b'[READ-WRITE]', async_=True)
+         else:
+-            self.sendUntaggedResponse(message=b'[READ-ONLY]', async=True)
++            self.sendUntaggedResponse(message=b'[READ-ONLY]', async_=True)
+ 
+ 
+     def flagsChanged(self, newFlags):
+@@ -2508,14 +2509,16 @@ class IMAP4Server(basic.LineReceiver, policies.TimeoutMixin):
+             msg = intToBytes(mId) + (
+                 b' FETCH (FLAGS (' +b' '.join(encodedFlags) + b'))'
+             )
+-            self.sendUntaggedResponse(msg, async=True)
++            self.sendUntaggedResponse(msg, async_=True)
+ 
+ 
+     def newMessages(self, exists, recent):
+         if exists is not None:
+-            self.sendUntaggedResponse(intToBytes(exists) + b' EXISTS', async=True)
++            self.sendUntaggedResponse(
++                intToBytes(exists) + b' EXISTS', async_=True)
+         if recent is not None:
+-            self.sendUntaggedResponse(intToBytes(recent) + b' RECENT', async=True)
++            self.sendUntaggedResponse(
++                intToBytes(recent) + b' RECENT', async_=True)
+ 
+ 
+ TIMEOUT_ERROR = error.TimeoutError()
+diff --git a/src/twisted/python/compat.py b/src/twisted/python/compat.py
+index 855e427aa..ba13bb4dd 100644
+--- a/src/twisted/python/compat.py
++++ b/src/twisted/python/compat.py
+@@ -833,6 +833,29 @@ except ImportError:
+     from collections import Sequence
+ 
+ 
++def get_async_param(async_=None, **kwargs):
++    """
++    Provide a backwards-compatible way to get async param value that does not
++    cause a syntax error under Python 3.7.
++
++    @param async_: async_ param value (should default to None)
++    @type async_: L{bool}
++
++    @param kwargs: keyword arguments of the caller (only async is allowed)
++    @type async_: L{dict}
++
++    @raise TypeError: Both async_ and async specified.
++
++    @return: Final async_ param value
++    @rtype: L{bool}
++    """
++    if async_ is None and 'async' in kwargs:
++        async_ = kwargs.pop('async')
++    if kwargs:
++        raise TypeError
++    return bool(async_)
++
++
+ __all__ = [
+     "reraise",
+     "execfile",
+@@ -874,4 +897,5 @@ __all__ = [
+     "raw_input",
+     "_tokenize",
+     "Sequence",
++    "get_async_param",
+ ]
+-- 
+2.17.1
+
diff --git a/package/python-twisted/Config.in b/package/python-twisted/Config.in
index 344edb4a0a..b72952f979 100644
--- a/package/python-twisted/Config.in
+++ b/package/python-twisted/Config.in
@@ -1,9 +1,11 @@
 config BR2_PACKAGE_PYTHON_TWISTED
 	bool "python-twisted"
 	select BR2_PACKAGE_PYTHON_INCREMENTAL
+	select BR2_PACKAGE_PYTHON_ATTRS # runtime
 	select BR2_PACKAGE_PYTHON_AUTOMAT # runtime
 	select BR2_PACKAGE_PYTHON_CONSTANTLY # runtime
 	select BR2_PACKAGE_PYTHON_HYPERLINK # runtime
+	select BR2_PACKAGE_PYTHON_PYHAMCREST # runtime
 	select BR2_PACKAGE_PYTHON_ZOPE_INTERFACE # runtime
 	help
 	  Twisted is an event-driven networking engine written in
diff --git a/package/python-twisted/python-twisted.hash b/package/python-twisted/python-twisted.hash
index c22f33643f..89ae44043e 100644
--- a/package/python-twisted/python-twisted.hash
+++ b/package/python-twisted/python-twisted.hash
@@ -1,3 +1,5 @@
-# md5 from https://pypi.python.org/pypi/twisted/json, sha256 locally computed
-md5 cd5c287802dcbaf7be15cf937c922b71 Twisted-17.5.0.tar.bz2
-sha256 f198a494f0df2482f7c5f99d7f3eef33d22763ffc76641b36fec476b878002ea Twisted-17.5.0.tar.bz2
+# md5, sha256 from https://pypi.org/pypi/twisted/json
+md5 16396b4d8d7fd0d668736b3d510279db Twisted-18.7.0.tar.bz2
+sha256 95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4 Twisted-18.7.0.tar.bz2
+# Locally computed sha256
+sha256 a516053f954d4f16fbdffa8924e42d6d2490a7241fe5de053541a766ae778fd4 LICENSE
diff --git a/package/python-twisted/python-twisted.mk b/package/python-twisted/python-twisted.mk
index fe276d641e..9f54ecae4f 100644
--- a/package/python-twisted/python-twisted.mk
+++ b/package/python-twisted/python-twisted.mk
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-PYTHON_TWISTED_VERSION = 17.5.0
+PYTHON_TWISTED_VERSION = 18.7.0
 PYTHON_TWISTED_SOURCE = Twisted-$(PYTHON_TWISTED_VERSION).tar.bz2
-PYTHON_TWISTED_SITE = https://pypi.python.org/packages/31/bf/7f86a8f8b9778e90d8b2921e9f442a8c8aa33fd2489fc10f236bc8af1749
+PYTHON_TWISTED_SITE = https://files.pythonhosted.org/packages/90/50/4c315ce5d119f67189d1819629cae7908ca0b0a6c572980df5cc6942bc22
 PYTHON_TWISTED_SETUP_TYPE = setuptools
 PYTHON_TWISTED_LICENSE = MIT
 PYTHON_TWISTED_LICENSE_FILES = LICENSE
-- 
2.17.1

  parent reply	other threads:[~2018-09-26 15:35 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 15:34 [Buildroot] [PATCH 00/23] Fix python-crossbar to work with python 3.7 Asaf Kahlon
2018-09-26 15:34 ` [Buildroot] [PATCH 01/23] python-attrs: bump to version 18.2.0 Asaf Kahlon
2018-09-28  9:51   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 02/23] python-autobahn: bump to version 18.9.2 Asaf Kahlon
2018-09-28  9:52   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 03/23] python-automat: bump to version 0.7.0 Asaf Kahlon
2018-09-28  9:53   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 04/23] python-hyperlink: bump to version 18.0.0 Asaf Kahlon
2018-09-28 11:10   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 05/23] python-incremental: bump to version 17.5.0 Asaf Kahlon
2018-09-28 11:11   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 06/23] python-jinja2: bump to version 2.10 Asaf Kahlon
2018-09-28 11:12   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 07/23] python-lmdb: bump to version 0.94 Asaf Kahlon
2018-09-28 11:16   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 08/23] python-psutil: bump to version 5.4.7 Asaf Kahlon
2018-10-01  6:47   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 09/23] python-pycparser: bump to version 2.19 Asaf Kahlon
2018-10-01  6:47   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 10/23] python-pynacl: bump to version 1.2.1 Asaf Kahlon
2018-10-02 14:35   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 11/23] python-pyopenssl: bump to version 18.0.0 Asaf Kahlon
2018-10-02 14:40   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 12/23] python-sdnotify: bump to version 0.3.2 Asaf Kahlon
2018-10-02 14:42   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 13/23] python-sortedcontainers: bump to version 2.0.5 Asaf Kahlon
2018-10-02 14:43   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 14/23] python-txaio: bump to version 18.8.1 Asaf Kahlon
2018-10-02 14:55   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 15/23] python-txtorcon: bump to version 18.0.2 Asaf Kahlon
2018-09-29  5:37   ` Ricardo Martincoski
2018-09-29  7:24     ` Asaf Kahlon
2018-10-01  6:44     ` Thomas Petazzoni
2018-10-03 13:39   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 16/23] python-u-msgpack: bump to version 2.5.0 Asaf Kahlon
2018-10-03 14:00   ` Thomas Petazzoni
2018-09-26 15:34 ` [Buildroot] [PATCH 17/23] python-zope-interface: bump to version 4.5.0 Asaf Kahlon
2018-10-03 19:02   ` Thomas Petazzoni
2018-09-26 15:35 ` [Buildroot] [PATCH 18/23] python-pytrie: bump to version 0.3.1 Asaf Kahlon
2018-09-26 15:35 ` [Buildroot] [PATCH 19/23] python-passlib: new package Asaf Kahlon
2018-10-04 11:50   ` Thomas Petazzoni
2018-10-06 15:05     ` Yegor Yefremov
2018-09-26 15:35 ` [Buildroot] [PATCH 20/23] python-pyasn1-modules: " Asaf Kahlon
2018-10-04 11:59   ` Thomas Petazzoni
2018-09-26 15:35 ` [Buildroot] [PATCH 21/23] python-pyhamcrest: " Asaf Kahlon
2018-10-04 12:02   ` Thomas Petazzoni
2018-10-04 19:30     ` Asaf Kahlon
2018-10-06 15:03       ` Yegor Yefremov
2018-09-26 15:35 ` Asaf Kahlon [this message]
2018-09-26 15:45   ` [Buildroot] [PATCH 22/23] python-twisted: bump to version 18.7.0 Yegor Yefremov
2018-10-04 12:17   ` Thomas Petazzoni
2018-09-26 15:35 ` [Buildroot] [PATCH 23/23] python-crossbar: bump to version 18.9.2 Asaf Kahlon
2018-10-04 12:17   ` Thomas Petazzoni
2018-09-26 15:54 ` [Buildroot] [PATCH 00/23] Fix python-crossbar to work with python 3.7 Yegor Yefremov
2018-09-27  6:19   ` Yegor Yefremov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926153505.3411-23-asafka7@gmail.com \
    --to=asafka7@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox