From 4ed55d00511ea3d9115b76c463e1a466408b11ef Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Sun, 14 Mar 2021 11:56:49 +0100 Subject: [PATCH] build: add pyinstaller hook for googleapiclient (#5619) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build: add pyinstaller hook for googleapiclient The Google API Discovery Service JSON files from googleapiclient/discovery_cache/documents were being excluded due to a bug and, particularly, drive.v2.json is essential for our gdrive backend. Now we're explicitly asking PyInstaller to embed these files on the generated packages. Fixes #5618 * Suppress linter error for unrecognized imports Co-authored-by: Peter Rowlands (변기호) * Apply black style after manual code review Co-authored-by: Peter Rowlands (변기호) --- scripts/hooks/hook-googleapiclient.model.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 scripts/hooks/hook-googleapiclient.model.py diff --git a/scripts/hooks/hook-googleapiclient.model.py b/scripts/hooks/hook-googleapiclient.model.py new file mode 100644 index 000000000..e73889752 --- /dev/null +++ b/scripts/hooks/hook-googleapiclient.model.py @@ -0,0 +1,8 @@ +"""Temporary fix for https://github.com/iterative/dvc/issues/5618.""" +from PyInstaller.utils.hooks import ( # pylint:disable=import-error + collect_data_files, + copy_metadata, +) + +datas = collect_data_files("googleapiclient.discovery") +datas += copy_metadata("google_api_python_client")