trezor-agent icon indicating copy to clipboard operation
trezor-agent copied to clipboard

setup: remove dep on backport of shutil

Open radfish opened this issue 1 year ago • 1 comments

This backport was needed only for Python 2 (the shutil.which module was backported from Python 3 to 2). In Python 3, the module is imported from the built-in standard library.

This resolves issues with packaging for distributions, since that backported package doesn't exist.ror if missing.

See libagent/util.py:241:

    try:
        # For Python 3
        from shutil import which as _which
    except ImportError:
        # For Python 2
        from backports.shutil_which import which as _which

If Python 2 is still supported, then the dependency in setup.py would need to be made conditional on Python version. I am assuming Python 2 is not actually supported, so I just removed the dependency altogether. This try catch in util.py could also be removed, if Python 2 is not actually supported.

radfish avatar Jun 24 '24 06:06 radfish

This should be merged, as distros that ship trezor-agent currently all patch this out.

Midar avatar Sep 21 '24 13:09 Midar