From 1b5deb045af5de6cf3051b3a311c3f09283dc5e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Br=C3=A9nainn=20Woodsend?= Date: Mon, 15 Jan 2024 19:40:53 +0000 Subject: [PATCH] Collect metadata for eth-hash>=0.6 --- news/688.update.rst | 1 + requirements-test-libraries.txt | 1 + .../hooks/stdhooks/hook-eth_hash.py | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 news/688.update.rst diff --git a/news/688.update.rst b/news/688.update.rst new file mode 100644 index 00000000..2eba6575 --- /dev/null +++ b/news/688.update.rst @@ -0,0 +1 @@ +Collect package metadata for ``eth-hash`` (fixes ``PackageNotFoundError``). diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 1f56c35a..589a25a8 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -170,6 +170,7 @@ langchain==0.1.0 seedir==0.4.2 cel-python==0.1.5 pygwalker==0.4.2 +eth-hash==0.6.0 # ------------------- Platform (OS) specifics diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_hash.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_hash.py index 1b22c286..89864fde 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_hash.py +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_hash.py @@ -10,7 +10,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later # ------------------------------------------------------------------ -from PyInstaller.utils.hooks import collect_submodules +from PyInstaller.utils.hooks import collect_submodules, copy_metadata, is_module_satisfies # The ``eth_hash.utils.load_backend`` function does a dynamic import. hiddenimports = collect_submodules('eth_hash.backends') + +# As of eth-hash 0.6.0, it uses importlib.metadata.version() set its __version__ attribute +if is_module_satisfies("eth-hash >= 0.6.0"): + datas = copy_metadata("eth-hash")