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")