Skip to content

Commit

Permalink
hooks: add hook for eth_rlp
Browse files Browse the repository at this point in the history
Starting with v1.0.0, `eth_rlp` queries its version from metadata.
  • Loading branch information
rokm committed Dec 18, 2023
1 parent 772bacb commit f9c592d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/672.new.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``eth_rlp``.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ pythainlp==4.1.0b5
gmsh==4.11.1
sspilib==0.1.0
rlp==4.0.0
eth-rlp==1.0.0

# ------------------- Platform (OS) specifics

Expand Down
17 changes: 17 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-eth_rlp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ------------------------------------------------------------------
# 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 is_module_satisfies, copy_metadata

# Starting with v1.0.0, `eth_rlp` queries its version from metadata.
if is_module_satisfies("eth-rlp >= 1.0.0"):
datas = copy_metadata('eth-rlp')
7 changes: 7 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,3 +1907,10 @@ def test_rlp(pyi_builder):
pyi_builder.test_source("""
import rlp
""")


@importorskip('eth_rlp')
def test_eth_rlp(pyi_builder):
pyi_builder.test_source("""
import eth_rlp
""")

0 comments on commit f9c592d

Please sign in to comment.