Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooks for eth_typing and eth_utils #656

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/656.new.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``eth_utils`` to collect its embedded JSON files.
1 change: 1 addition & 0 deletions news/656.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``eth_typing`` which requires its package metadata.
2 changes: 2 additions & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_typing.py
Original file line number Diff line number Diff line change
@@ -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")
Original file line number Diff line number Diff line change
@@ -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")
15 changes: 15 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading