Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/twisted/, dev-python/twisted/files/
Date: Tue, 01 Jun 2021 20:35:45
Message-Id: 1622579734.28edb49d257baa865d6fa94e1ab9e1a8a29a8d1f.mgorny@gentoo
1 commit: 28edb49d257baa865d6fa94e1ab9e1a8a29a8d1f
2 Author: Ekaterina Vaartis <vaartis <AT> kotobank <DOT> ch>
3 AuthorDate: Sat May 15 21:22:13 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 1 20:35:34 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28edb49d
7
8 dev-python/twisted: Bump to python 3.10
9
10 Signed-off-by: Ekaterina Vaartis <vaartis <AT> kotobank.ch>
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12
13 .../twisted/files/twisted-21.2.0-force-gtk3.patch | 42 ++++++++++++++++++++++
14 .../files/twisted-21.2.0-int-from-bytes.patch | 14 ++++++++
15 ...sted-21.2.0.ebuild => twisted-21.2.0-r1.ebuild} | 14 ++++++--
16 3 files changed, 68 insertions(+), 2 deletions(-)
17
18 diff --git a/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch b/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
19 new file mode 100644
20 index 00000000000..bed31bcf611
21 --- /dev/null
22 +++ b/dev-python/twisted/files/twisted-21.2.0-force-gtk3.patch
23 @@ -0,0 +1,42 @@
24 +diff --git a/src/twisted/internet/gireactor.py b/src/twisted/internet/gireactor.py
25 +index 92596db1da2..a577825a87e 100644
26 +--- a/src/twisted/internet/gireactor.py
27 ++++ b/src/twisted/internet/gireactor.py
28 +@@ -24,6 +24,7 @@
29 + from twisted.internet.error import ReactorAlreadyRunning
30 + from twisted.internet import _glibbase
31 + from twisted.python import runtime
32 ++import gi
33 + import gi.pygtkcompat
34 + from gi.repository import GLib
35 +
36 +@@ -68,6 +69,7 @@ class GIReactor(_glibbase.GlibReactorBase):
37 + def __init__(self, useGtk=False):
38 + _gtk = None
39 + if useGtk is True:
40 ++ gi.require_version("Gtk", "3.0")
41 + from gi.repository import Gtk as _gtk
42 +
43 + _glibbase.GlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk)
44 +@@ -112,6 +114,7 @@ class PortableGIReactor(_glibbase.PortableGlibReactorBase):
45 + def __init__(self, useGtk=False):
46 + _gtk = None
47 + if useGtk is True:
48 ++ gi.require_version("Gtk", "3.0")
49 + from gi.repository import Gtk as _gtk
50 +
51 + _glibbase.PortableGlibReactorBase.__init__(self, GLib, _gtk, useGtk=useGtk)
52 +diff --git a/src/twisted/internet/test/test_gireactor.py b/src/twisted/internet/test/test_gireactor.py
53 +index d15a9262248..af5092a3614 100644
54 +--- a/src/twisted/internet/test/test_gireactor.py
55 ++++ b/src/twisted/internet/test/test_gireactor.py
56 +@@ -25,6 +25,9 @@
57 + gtk3reactor = None
58 + else:
59 + gtk3reactor = _gtk3reactor
60 ++ import gi # type: ignore[import]
61 ++
62 ++ gi.require_version("Gtk", "3.0")
63 + from gi.repository import Gtk
64 +
65 + from twisted.internet.error import ReactorAlreadyRunning
66
67 diff --git a/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch b/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
68 new file mode 100644
69 index 00000000000..ef9bd777ac7
70 --- /dev/null
71 +++ b/dev-python/twisted/files/twisted-21.2.0-int-from-bytes.patch
72 @@ -0,0 +1,14 @@
73 +diff --git a/src/twisted/conch/ssh/common.py b/src/twisted/conch/ssh/common.py
74 +index 3e4f8cdc7..ee3d63143 100644
75 +--- a/src/twisted/conch/ssh/common.py
76 ++++ b/src/twisted/conch/ssh/common.py
77 +@@ -11,7 +11,8 @@ Maintainer: Paul Swartz
78 +
79 + import struct
80 +
81 +-from cryptography.utils import int_from_bytes, int_to_bytes
82 ++from cryptography.utils import int_to_bytes
83 ++int_from_bytes = int.from_bytes
84 +
85 + from twisted.python.deprecate import deprecated
86 + from twisted.python.versions import Version
87
88 diff --git a/dev-python/twisted/twisted-21.2.0.ebuild b/dev-python/twisted/twisted-21.2.0-r1.ebuild
89 similarity index 92%
90 rename from dev-python/twisted/twisted-21.2.0.ebuild
91 rename to dev-python/twisted/twisted-21.2.0-r1.ebuild
92 index d62ac660826..5d0d092f5d4 100644
93 --- a/dev-python/twisted/twisted-21.2.0.ebuild
94 +++ b/dev-python/twisted/twisted-21.2.0-r1.ebuild
95 @@ -3,8 +3,7 @@
96
97 EAPI=7
98
99 -DISTUTILS_USE_SETUPTOOLS=rdepend
100 -PYTHON_COMPAT=( python3_{7..9} )
101 +PYTHON_COMPAT=( python3_{7..10} )
102 PYTHON_REQ_USE="threads(+)"
103
104 inherit distutils-r1 virtualx
105 @@ -77,6 +76,13 @@ BDEPEND="
106 )
107 "
108
109 +PATCHES=(
110 + # https://twistedmatrix.com/trac/ticket/10200
111 + "${FILESDIR}/${P}-force-gtk3.patch"
112 + # int_from_bytes is deprecated
113 + "${FILESDIR}/${P}-int-from-bytes.patch"
114 +)
115 +
116 python_prepare_all() {
117 eapply "${FILESDIR}"/${P}-incremental-21.patch
118
119 @@ -101,6 +107,10 @@ python_prepare_all() {
120 skip = "Requires extra permissions"' \
121 -i src/twisted/pair/test/test_tuntap.py || die
122
123 + # These tests rely on warnings which seems work unreliably between python versions
124 + sed -e 's:test_currentEUID:_&:' \
125 + -e 's:test_currentUID:_&:' -i src/twisted/python/test/test_util.py || die
126 +
127 # relies on the pre-CVE parse_qs() behavior in Python
128 sed -e '/d=c;+=f/d' \
129 -i src/twisted/web/test/test_http.py || die