diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5775ef36..1d70d43f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 diff --git a/agents/fake/setup.py b/agents/fake/setup.py index 451e908c..e84a50b9 100644 --- a/agents/fake/setup.py +++ b/agents/fake/setup.py @@ -11,6 +11,7 @@ author='Roman Zeyde', author_email='dev@romanzey.de', url='http://github.com/romanz/trezor-agent', + python_requires='>=3.8', scripts=['fake_device_agent.py'], install_requires=[ 'libagent>=0.9.0', diff --git a/agents/jade/setup.py b/agents/jade/setup.py index 96903b68..7b4e80b4 100644 --- a/agents/jade/setup.py +++ b/agents/jade/setup.py @@ -8,6 +8,7 @@ author='Jamie C. Driver', author_email='jamie@blockstream.com', url='http://github.com/romanz/trezor-agent', + python_requires='>=3.8', scripts=['jade_agent.py'], install_requires=[ 'libagent>=0.14.5', diff --git a/agents/keepkey/setup.py b/agents/keepkey/setup.py index 3b32d1cb..f68aa838 100644 --- a/agents/keepkey/setup.py +++ b/agents/keepkey/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', scripts=['keepkey_agent.py'], install_requires=[ 'libagent>=0.9.0', diff --git a/agents/ledger/setup.py b/agents/ledger/setup.py index e4248b2b..b4bb08f6 100644 --- a/agents/ledger/setup.py +++ b/agents/ledger/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', scripts=['ledger_agent.py'], install_requires=[ 'libagent>=0.9.0', diff --git a/agents/onlykey/setup.py b/agents/onlykey/setup.py index 140fb1fb..c333c7bd 100644 --- a/agents/onlykey/setup.py +++ b/agents/onlykey/setup.py @@ -8,6 +8,7 @@ author='CryptoTrust', author_email='t@crp.to', url='http://github.com/trustcrypto/onlykey-agent', + python_requires='>=3.8', scripts=['onlykey_agent.py'], install_requires=[ 'libagent>=0.14.2', diff --git a/agents/trezor/setup.py b/agents/trezor/setup.py index 1c8582a4..28d21736 100644 --- a/agents/trezor/setup.py +++ b/agents/trezor/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', scripts=['trezor_agent.py'], install_requires=[ 'libagent>=0.14.0', 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',