diff --git a/news/656.new.1.rst b/news/656.new.1.rst new file mode 100644 index 00000000..ae386326 --- /dev/null +++ b/news/656.new.1.rst @@ -0,0 +1 @@ +Add hook for ``eth_utils`` to collect its embedded JSON files. diff --git a/news/656.new.rst b/news/656.new.rst new file mode 100644 index 00000000..b67244e3 --- /dev/null +++ b/news/656.new.rst @@ -0,0 +1 @@ +Add hook for ``eth_typing`` which requires its package metadata. diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 853ee8be..a570e832 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -28,6 +28,8 @@ dash-uploader==0.6.0 # discid requires libdiscid to be provided by the system. # We install it via apt-get and brew on ubuntu and macOS CI runners, respectively. discid==1.2.0; sys_platform != 'win32' +eth_typing==3.5.1 +eth_utils==2.3.0 fabric==3.2.2 fiona==1.9.5; sys_platform != 'win32' folium==0.14.0 diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_typing.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_typing.py new file mode 100644 index 00000000..85c2e0ee --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_typing.py @@ -0,0 +1,16 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2023 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +from PyInstaller.utils.hooks import copy_metadata + +# eth-typing queries it's own version using importlib.metadata/pkg_resources. +datas = copy_metadata("eth-typing") diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_utils.network.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_utils.network.py new file mode 100644 index 00000000..fcf6432a --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_utils.network.py @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2020 PyInstaller Development Team. +# +# This file is distributed under the terms of the GNU General Public +# License (version 2.0 or later). +# +# The full license is available in LICENSE.GPL.txt, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files("eth_utils") diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index eab87e34..3908fcef 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -640,6 +640,21 @@ def test_googleapiclient(pyi_builder): """) +@importorskip('eth_typing') +def test_eth_typing(pyi_builder): + pyi_builder.test_source(""" + import eth_typing + """) + + +@importorskip("eth_utils") +def test_eth_utils_network(pyi_builder): + pyi_builder.test_source(""" + import eth_utils.network + eth_utils.network.name_from_chain_id(1) + """) + + @importorskip('plotly') @importorskip('pandas') def test_plotly(pyi_builder):