aboutsummaryrefslogtreecommitdiff
path: root/python/python3-libagent/480.diff
diff options
context:
space:
mode:
authornomnombtc <nomnombtc@arcor.de>2025-08-29 15:25:56 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2025-08-29 16:20:35 +0700
commitf6de60173e15c3f546a7df835263262e1f7bd9a6 (patch)
treeb99e612406cbac6de19af1be41f51338446fd16f /python/python3-libagent/480.diff
parent96817ceff14d1280bdd385781cdd6be286e4d2f3 (diff)
python/python3-libagent: Added (Hardware-based SSH/GPG/age agent).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python3-libagent/480.diff')
-rw-r--r--python/python3-libagent/480.diff102
1 files changed, 102 insertions, 0 deletions
diff --git a/python/python3-libagent/480.diff b/python/python3-libagent/480.diff
new file mode 100644
index 0000000000..601513ed2b
--- /dev/null
+++ b/python/python3-libagent/480.diff
@@ -0,0 +1,102 @@
+diff --git a/libagent/age/__init__.py b/libagent/age/__init__.py
+index dd2fbe66..e20cb3c4 100644
+--- a/libagent/age/__init__.py
++++ b/libagent/age/__init__.py
+@@ -13,9 +13,9 @@
+ import logging
+ import os
+ import sys
++from importlib import metadata
+
+ import bech32
+-import pkg_resources
+ from cryptography.exceptions import InvalidTag
+ from cryptography.hazmat.primitives.ciphers.aead import ChaCha20Poly1305
+
+@@ -150,9 +150,8 @@ def main(device_type):
+ p = argparse.ArgumentParser()
+
+ agent_package = device_type.package_name()
+- resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
+- resources = [resources_map[agent_package], resources_map['libagent']]
+- versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
++ resources = [metadata.distribution(agent_package), metadata.distribution('libagent')]
++ versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
+ p.add_argument('--version', help='print the version info',
+ action='version', version=versions)
+
+diff --git a/libagent/gpg/__init__.py b/libagent/gpg/__init__.py
+index 6bad4f65..4f1b166d 100644
+--- a/libagent/gpg/__init__.py
++++ b/libagent/gpg/__init__.py
+@@ -17,13 +17,13 @@
+ import stat
+ import subprocess
+ import sys
++from importlib import metadata
+
+ try:
+ # TODO: Not supported on Windows. Use daemoniker instead?
+ import daemon
+ except ImportError:
+ daemon = None
+-import pkg_resources
+ import semver
+
+ from .. import device, formats, server, util
+@@ -308,9 +308,8 @@ def main(device_type):
+ parser = argparse.ArgumentParser(epilog=epilog)
+
+ agent_package = device_type.package_name()
+- resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
+- resources = [resources_map[agent_package], resources_map['libagent']]
+- versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
++ resources = [metadata.distribution(agent_package), metadata.distribution('libagent')]
++ versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
+ parser.add_argument('--version', help='print the version info',
+ action='version', version=versions)
+
+diff --git a/libagent/ssh/__init__.py b/libagent/ssh/__init__.py
+index dee3ee24..14f2656d 100644
+--- a/libagent/ssh/__init__.py
++++ b/libagent/ssh/__init__.py
+@@ -13,6 +13,7 @@
+ import sys
+ import tempfile
+ import threading
++from importlib import metadata
+
+ import configargparse
+
+@@ -21,7 +22,6 @@
+ import daemon
+ except ImportError:
+ daemon = None
+-import pkg_resources
+
+ from .. import device, formats, server, util
+ from . import client, protocol
+@@ -83,9 +83,8 @@ def create_agent_parser(device_type):
+ p.add_argument('-v', '--verbose', default=0, action='count')
+
+ agent_package = device_type.package_name()
+- resources_map = {r.key: r for r in pkg_resources.require(agent_package)}
+- resources = [resources_map[agent_package], resources_map['libagent']]
+- versions = '\n'.join('{}={}'.format(r.key, r.version) for r in resources)
++ resources = [metadata.distribution(agent_package), metadata.distribution('libagent')]
++ versions = '\n'.join('{}={}'.format(r.metadata['Name'], r.version) for r in resources)
+ p.add_argument('--version', help='print the version info',
+ action='version', version=versions)
+
+diff --git a/setup.py b/setup.py
+index 10586f2e..4c21923a 100755
+--- a/setup.py
++++ b/setup.py
+@@ -8,6 +8,7 @@
+ author='Roman Zeyde',
+ author_email='dev@romanzey.de',
+ url='http://github.com/romanz/trezor-agent',
++ python_requires='>=3.8',
+ packages=[
+ 'libagent',
+ 'libagent.age',