From f3cd1cd526c7b7919bb685edc7010aaa68c222f3 Mon Sep 17 00:00:00 2001 From: Ryan Benson Date: Tue, 27 Apr 2021 13:09:41 -0700 Subject: [PATCH] Add copy_metadata to pycountry hook (#113) Based off this thread: http://pyinstaller.47505.x6.nabble.com/PyInstaller-not-working-with-module-pycountry-td3064.html I faced this same issue and used this modified hook, and it worked. --- news/113.update.rst | 1 + .../hooks/stdhooks/hook-pycountry.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news/113.update.rst diff --git a/news/113.update.rst b/news/113.update.rst new file mode 100644 index 000000000..a9f56cda7 --- /dev/null +++ b/news/113.update.rst @@ -0,0 +1 @@ +Update the hook for ``pycountry`` to copy metadata, in addition to collecting data files. diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pycountry.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pycountry.py index e45f6a706..19be45205 100644 --- a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pycountry.py +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-pycountry.py @@ -10,9 +10,9 @@ # SPDX-License-Identifier: GPL-2.0-or-later # ------------------------------------------------------------------ -from PyInstaller.utils.hooks import collect_data_files +from PyInstaller.utils.hooks import collect_data_files, copy_metadata # pycountry requires the ISO databases for country data. # Tested v1.15 on Linux/Ubuntu. # https://pypi.python.org/pypi/pycountry -datas = collect_data_files('pycountry') +datas = copy_metadata('pycountry') + collect_data_files('pycountry')