hextreezorctl
=============

This package contains a copy of python-trezor (trezorlib) version 0.11.2,
Copyright (C) 2012-2019 SatoshiLabs and contributors, distributed under the GNU
Lesser General Public License version 3 or later. The full licence text is in
LICENSE, and the upstream credits are reproduced in AUTHORS-trezorlib.

Upstream source:  https://github.com/trezor/trezor-firmware
Release:          python/v0.11.2 (2019-02-27)

Redistributed here under the terms of the LGPL. hextreezorctl as a whole is
therefore licensed LGPL-3.0-or-later.


Everything under src/hextreezorctl/_vendor/ and src/hextreezorctl/cli.py is
produced by tools/vendor.py, which fetches the upstream wheel, verifies its
SHA-256, and applies exactly the changes below. Run it to reproduce or update
the vendored tree; do not edit those files by hand.


Changes made to the vendored copy
---------------------------------

1. src/hextreezorctl/_vendor/trezorlib/

   Verbatim, except:

   - firmware.py: `import pyblake2` replaced with `import hashlib as pyblake2`.
     pyblake2 was the backport of hashlib.blake2 for Python below 3.6 and no
     longer compiles - CPython 3.11 made Py_TYPE() non-assignable. The stdlib
     has provided blake2b and blake2s since 3.6, so the names resolve
     identically. This is the only reason 0.11.2 could not otherwise be
     installed on a current Python.

   - trezorlib/stellar.py omitted, and the two Stellar commands removed from
     the command line tool. It needs xdrlib, which PEP 594 removed from the
     standard library in Python 3.13. The Stellar protobuf message definitions
     under trezorlib/messages/ are untouched; they carry no such dependency.

   - trezorlib/tests/ and trezorlib/qt/ omitted. Neither is reachable from the
     command line tool; the former needs pytest and imports trezorlib by
     absolute name, the latter needs PyQt.

2. src/hextreezorctl/cli.py

   Upstream shipped its command line tool as a top level script named
   `trezorctl` rather than as an importable module. It is reproduced here as a
   module so it can be an entry point, with three changes:

   - the shebang line removed;
   - its four absolute `trezorlib` imports rewritten to reach the vendored copy
     (`from ._vendor.trezorlib import ...`);
   - the `stellar` import and the `stellar-get-address` and
     `stellar-sign-transaction` commands removed, per the note above.

   Nothing else in the file was touched, including the commands and their
   options.

3. No other file in the vendored tree was modified.


Dependency note
---------------

Upstream asked for `construct>=2.9`. This package requires `construct>=2.10`,
because 2.9 does `import imp` at module scope and imp was removed in Python
3.12. 2.10 parses the firmware image formats trezorlib 0.11.2 defines without
complaint.
