[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1033660: unblock: pydle/0.9.4-4



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: pydle@packages.debian.org
Control: affects -1 + src:pydle

Please unblock package pydle

[ Reason ]
Fixes FTBFS #1031974.

[ Impact ]
pydle will be auto-removed from bookworm without an unblock.

[ Tests ]
Building or running pydle with python3.11 result in Python exceptions.

[ Risks ]
None; all applied changes stem from upstream.

[ Checklist ]
  [x] all changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in testing

unblock pydle/0.9.4-4
diff -Nru pydle-0.9.4/debian/changelog pydle-0.9.4/debian/changelog
--- pydle-0.9.4/debian/changelog	2022-06-14 22:45:53.000000000 +0200
+++ pydle-0.9.4/debian/changelog	2023-03-22 11:57:39.000000000 +0100
@@ -1,3 +1,12 @@
+pydle (0.9.4-4) unstable; urgency=medium
+
+  * Team upload.
+  * Patch: Remove Deprecated Marker from WHOIS. (Closes: #1031974)
+  * Patch: Remove not used coroutine import.
+  * Patch: Fixup irccat.py example.
+
+ -- Bastian Germann <bage@debian.org>  Wed, 22 Mar 2023 11:57:39 +0100
+
 pydle (0.9.4-3) unstable; urgency=medium
 
   [ Ondřej Nový ]
diff -Nru pydle-0.9.4/debian/patches/Fixup-irccat.py-example.patch pydle-0.9.4/debian/patches/Fixup-irccat.py-example.patch
--- pydle-0.9.4/debian/patches/Fixup-irccat.py-example.patch	1970-01-01 01:00:00.000000000 +0100
+++ pydle-0.9.4/debian/patches/Fixup-irccat.py-example.patch	2023-03-22 11:57:39.000000000 +0100
@@ -0,0 +1,97 @@
+Origin: upstream, b747ce1bd1e46038bc5e4c3eff1a64175f0908dd
+From: Joshua Salzedo <joshuasalzedo@gmail.com>
+Date: Sat, 21 Nov 2020 20:45:44 -0800
+Subject: [#151] Fixup irccat.py example
+
+---
+ pydle/utils/irccat.py | 50 ++++++++++++++++++++++---------------------
+ 1 file changed, 26 insertions(+), 24 deletions(-)
+
+diff --git a/pydle/utils/irccat.py b/pydle/utils/irccat.py
+index 47a857c..495018d 100644
+--- a/pydle/utils/irccat.py
++++ b/pydle/utils/irccat.py
+@@ -8,57 +8,59 @@
+ import asyncio
+ from asyncio.streams import FlowControlMixin
+ 
+-from .. import  Client, __version__
++from .. import Client, __version__
+ from . import _args
+ import asyncio
+ 
++
+ class IRCCat(Client):
+     """ irccat. Takes raw messages on stdin, dumps raw messages to stdout. Life has never been easier. """
++
+     def __init__(self, *args, **kwargs):
+         super().__init__(*args, **kwargs)
+         self.async_stdin = None
+ 
+-    @asyncio.coroutine
+-    def _send(self, data):
+-        sys.stdout.write(data)
+-        yield from super()._send(data)
++    async def _send(self, data):
++        await super(IRCCat, self)._send(data)
+ 
+-    @asyncio.coroutine
+-    def process_stdin(self):
++    async def process_stdin(self):
+         """ Yes. """
+-        loop = self.eventloop.loop
++        loop = asyncio.get_event_loop()
+ 
+         self.async_stdin = asyncio.StreamReader()
+         reader_protocol = asyncio.StreamReaderProtocol(self.async_stdin)
+-        yield from loop.connect_read_pipe(lambda: reader_protocol, sys.stdin)
++        await loop.connect_read_pipe(lambda: reader_protocol, sys.stdin)
+ 
+         while True:
+-            line = yield from self.async_stdin.readline()
++            line = await self.async_stdin.readline()
+             if not line:
+                 break
+-            yield from self.raw(line.decode('utf-8'))
++            await self.raw(line.decode('utf-8'))
+ 
+-        yield from self.quit('EOF')
++        await self.quit('EOF')
+ 
+-    @asyncio.coroutine
+-    def on_raw(self, message):
++    async def on_raw(self, message):
+         print(message._raw)
+-        yield from super().on_raw(message)
++        await super().on_raw(message)
++
++    async def on_ctcp_version(self, source, target, contents):
++        await self.ctcp_reply(source, 'VERSION', 'pydle-irccat v{}'.format(__version__))
++
+ 
+-    @asyncio.coroutine
+-    def on_ctcp_version(self, source, target, contents):
+-        self.ctcp_reply(source, 'VERSION', 'pydle-irccat v{}'.format(__version__))
++async def _main():
++    # Create client.
++    irccat, connect = _args.client_from_args('irccat', default_nick='irccat',
++                                             description='Process raw IRC messages from stdin, dump received IRC messages to stdout.',
++                                             cls=IRCCat)
++    await connect()
++    while True:
++        await irccat.process_stdin()
+ 
+ 
+ def main():
+     # Setup logging.
+     logging.basicConfig(format='!! %(levelname)s: %(message)s')
+-
+-    # Create client.
+-    irccat, connect = _args.client_from_args('irccat', default_nick='irccat', description='Process raw IRC messages from stdin, dump received IRC messages to stdout.', cls=IRCCat)
+-
+-    irccat.eventloop.schedule_async(connect())
+-    irccat.eventloop.run_with(irccat.process_stdin())
++    asyncio.get_event_loop().run_until_complete(_main())
+ 
+ 
+ if __name__ == '__main__':
diff -Nru pydle-0.9.4/debian/patches/Remove-Deprecated-Marker-from-WHOIS.patch pydle-0.9.4/debian/patches/Remove-Deprecated-Marker-from-WHOIS.patch
--- pydle-0.9.4/debian/patches/Remove-Deprecated-Marker-from-WHOIS.patch	1970-01-01 01:00:00.000000000 +0100
+++ pydle-0.9.4/debian/patches/Remove-Deprecated-Marker-from-WHOIS.patch	2023-03-22 11:54:43.000000000 +0100
@@ -0,0 +1,40 @@
+Origin: upstream, b96190aa8f8622294fed28bc519474ec09702cfc
+From: David Sangrey <davidsangrey@gmail.com>
+Date: Tue, 22 Mar 2022 03:45:08 -0400
+Subject: [#161] Remove Deprecated Marker from WHOIS
+
+Resolves #161, related to #142
+---
+ docs/usage.rst            | 2 +-
+ pydle/features/account.py | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/docs/usage.rst b/docs/usage.rst
+index 20d7a38..5236816 100644
+--- a/docs/usage.rst
++++ b/docs/usage.rst
+@@ -189,7 +189,7 @@ Fortunately, pydle utilizes asyncio coroutines_ which allow you to handle a bloc
+ while still retaining the benefits of asynchronous program flow. Coroutines allow pydle to be notified when a blocking operation is done,
+ and then resume execution of the calling function appropriately. That way, blocking operations do not block the entire program flow.
+ 
+-In order for a function to be declared as a coroutine, it has to be declared as an ``async def`` function or decorated with the :meth:`asyncio.coroutine` decorator.
++In order for a function to be declared as a coroutine, it has to be declared as an ``async def`` function.
+ It can then call functions that would normally block using Python's ``await`` operator.
+ Since a function that calls a blocking function is itself blocking too, it has to be declared a coroutine as well.
+ 
+diff --git a/pydle/features/account.py b/pydle/features/account.py
+index e181561..a67574c 100644
+--- a/pydle/features/account.py
++++ b/pydle/features/account.py
+@@ -22,9 +22,8 @@ def _rename_user(self, user, new):
+         self.whois(new)
+ 
+     ## IRC API.
+-    @asyncio.coroutine
+-    def whois(self, nickname):
+-        info = yield from super().whois(nickname)
++    async def whois(self, nickname):
++        info = await super().whois(nickname)
+         info.setdefault('account', None)
+         info.setdefault('identified', False)
+         return info
diff -Nru pydle-0.9.4/debian/patches/Remove-not-used-coroutine-import.patch pydle-0.9.4/debian/patches/Remove-not-used-coroutine-import.patch
--- pydle-0.9.4/debian/patches/Remove-not-used-coroutine-import.patch	1970-01-01 01:00:00.000000000 +0100
+++ pydle-0.9.4/debian/patches/Remove-not-used-coroutine-import.patch	2023-03-22 11:57:39.000000000 +0100
@@ -0,0 +1,21 @@
+Origin: backport, e6ccb16d74e4a1b6b8f16075f2ed466e1294d96f
+From: Daniel Garcia Moreno <daniel.garcia@suse.com>
+Date: Thu, 23 Feb 2023 19:04:58 +0100
+Subject: Remove not used coroutine import
+
+coroutine is removed from python since python 3.11, it's imported in the
+__init__.py file but not used anywhere so that can be removed safely.
+---
+diff --git a/pydle/__init__.py b/pydle/__init__.py
+index b92c8d3..734fcef 100644
+--- a/pydle/__init__.py
++++ b/pydle/__init__.py
+@@ -5,7 +5,7 @@ from .features.ircv3.cap import NEGOTIATING as CAPABILITY_NEGOTIATING, FAILED as
+     NEGOTIATED as CAPABILITY_NEGOTIATED
+ 
+ # noinspection PyUnresolvedReferences
+-from asyncio import coroutine, Future
++from asyncio import Future
+ 
+ __name__ = 'pydle'
+ __version__ = '0.9.4rc1'
diff -Nru pydle-0.9.4/debian/patches/series pydle-0.9.4/debian/patches/series
--- pydle-0.9.4/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ pydle-0.9.4/debian/patches/series	2023-03-22 11:57:39.000000000 +0100
@@ -0,0 +1,3 @@
+Fixup-irccat.py-example.patch
+Remove-Deprecated-Marker-from-WHOIS.patch
+Remove-not-used-coroutine-import.patch

Reply to: