-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(packages): make zerorpc work with Debian trixie
zerorpc was using methods future.utils to be compatible with both Python 2.x and 3.x but Debian trixie does not ship python3-future. Replace uses of the future module with (hopefully) equivalent Python 3.x constructs. Signed-off-by: Cedric Hombourger <[email protected]>
- Loading branch information
1 parent
0dd5804
commit 4b88e07
Showing
3 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
meta-isar/recipes-python/zerorpc/files/0002-do-not-use-future.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
License and copyright for files modified by this patch: | ||
|
||
SPDX-License-Identifier: MIT | ||
Copyright (c) 2015 François-Xavier Bourlet ([email protected]) | ||
|
||
Index: zerorpc-0.6.3/zerorpc/context.py | ||
=================================================================== | ||
--- zerorpc-0.6.3.orig/zerorpc/context.py | ||
+++ zerorpc-0.6.3/zerorpc/context.py | ||
@@ -23,9 +23,6 @@ | ||
# SOFTWARE. | ||
|
||
|
||
-from __future__ import absolute_import | ||
-from future.utils import tobytes | ||
- | ||
import uuid | ||
import random | ||
|
||
@@ -103,7 +100,7 @@ class Context(zmq.Context): | ||
return Context._instance | ||
|
||
def _reset_msgid(self): | ||
- self._msg_id_base = tobytes(uuid.uuid4().hex)[8:] | ||
+ self._msg_id_base = uuid.uuid4().hex[8:].encode('ascii') | ||
self._msg_id_counter = random.randrange(0, 2 ** 32) | ||
self._msg_id_counter_stop = random.randrange(self._msg_id_counter, 2 ** 32) | ||
|
||
@@ -112,7 +109,7 @@ class Context(zmq.Context): | ||
self._reset_msgid() | ||
else: | ||
self._msg_id_counter = (self._msg_id_counter + 1) | ||
- return tobytes('{0:08x}'.format(self._msg_id_counter)) + self._msg_id_base | ||
+ return f'{self._msg_id_counter:08x}'.encode('ascii') + self._msg_id_base | ||
|
||
def register_middleware(self, middleware_instance): | ||
registered_count = 0 | ||
Index: zerorpc-0.6.3/zerorpc/core.py | ||
=================================================================== | ||
--- zerorpc-0.6.3.orig/zerorpc/core.py | ||
+++ zerorpc-0.6.3/zerorpc/core.py | ||
@@ -23,10 +23,8 @@ | ||
# SOFTWARE. | ||
|
||
|
||
-from __future__ import absolute_import | ||
from builtins import str | ||
from builtins import zip | ||
-from future.utils import iteritems | ||
|
||
import sys | ||
import traceback | ||
@@ -67,7 +65,7 @@ class ServerBase(object): | ||
self._inject_builtins() | ||
self._heartbeat_freq = heartbeat | ||
|
||
- for (k, functor) in iteritems(self._methods): | ||
+ for (k, functor) in self._methods.items(): | ||
if not isinstance(functor, DecoratorBase): | ||
self._methods[k] = rep(functor) | ||
|
||
@@ -102,11 +100,11 @@ class ServerBase(object): | ||
return r | ||
|
||
def _zerorpc_inspect(self): | ||
- methods = dict((m, f) for m, f in iteritems(self._methods) | ||
+ methods = dict((m, f) for m, f in self._methods.items() | ||
if not m.startswith('_')) | ||
detailled_methods = dict((m, | ||
dict(args=self._format_args_spec(f._zerorpc_args()), | ||
- doc=f._zerorpc_doc())) for (m, f) in iteritems(methods)) | ||
+ doc=f._zerorpc_doc())) for (m, f) in methods.items()) | ||
return {'name': self._name, | ||
'methods': detailled_methods} | ||
|
6 changes: 6 additions & 0 deletions
6
meta-isar/recipes-python/zerorpc/files/zerorpc-0.6.3/debian/changelog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
zerorpc-python (0.6.3-6) testing; urgency=low | ||
|
||
* Remove use of the future module since not supported in Debian trixie | ||
|
||
-- Cedric Hombourger <[email protected]> Mon, 06 Jan 2024 15:30:00 +0100 | ||
|
||
zerorpc-python (0.6.3-5) testing; urgency=low | ||
|
||
* Pull fix submitted upstream for zerorpc to work with pyzmq 23.0.0 (issue #251) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters