Skip to content

Commit fe2deb3

Browse files
committed
hooks: add hook for schwifty
Add hook for `schwfity` that collects the data files (the JSON files in `bank_registry`) and package's metadata.
1 parent 277ff2c commit fe2deb3

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

news/742.new.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add hook for ``schwifty``. Requires ``schwifty >= 2024.5.1`` due to
2+
issues with data search path in earlier versions.

requirements-test-libraries.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ python-pptx==0.6.23
177177
opentelemetry-sdk==1.24.0
178178
xarray==2024.3.0; python_version >= '3.9'
179179
tables==3.9.2; python_version >= '3.9'
180+
schwifty==2024.5.2
180181

181182
# ------------------- Platform (OS) specifics
182183

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ------------------------------------------------------------------
2+
# Copyright (c) 2024 PyInstaller Development Team.
3+
#
4+
# This file is distributed under the terms of the GNU General Public
5+
# License (version 2.0 or later).
6+
#
7+
# The full license is available in LICENSE.GPL.txt, distributed with
8+
# this software.
9+
#
10+
# SPDX-License-Identifier: GPL-2.0-or-later
11+
# ------------------------------------------------------------------
12+
13+
from PyInstaller.utils.hooks import copy_metadata, collect_data_files
14+
15+
datas = copy_metadata('schwifty')
16+
datas += collect_data_files('schwifty')

src/_pyinstaller_hooks_contrib/tests/test_libraries.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,3 +2024,15 @@ def test_pytables(pyi_builder):
20242024
20252025
import tables
20262026
""", run_from_path=True)
2027+
2028+
2029+
@importorskip('schwifty')
2030+
def test_schwifty(pyi_builder):
2031+
pyi_builder.test_source("""
2032+
import schwifty
2033+
2034+
iban = schwifty.IBAN('DE89 3704 0044 0532 0130 00')
2035+
print(iban.country_code)
2036+
print(iban.bank_code)
2037+
print(iban.account_code)
2038+
""")

0 commit comments

Comments
 (0)