Skip to content

Commit

Permalink
hooks: gcloud: suppress errors
Browse files Browse the repository at this point in the history
Supress errors raised by `copy_metadata`; these may occur when
the hook is triggered by the `gcloud` namespace package from
`gcloud-aio-*` and `gcloud-rest-*` dists instead of the
`gcloud` package from the `gcloud` dist.
  • Loading branch information
rokm committed Apr 19, 2024
1 parent d2a4a24 commit ccc5f7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions news/731.update.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Suppress errors in ``gcloud`` hook that occur when the hook is triggered
by the ``gcloud`` namespace package from ``gcloud-aio-*`` and ``gcloud-rest-*``
dists instead of the ``gcloud`` package from the ``gcloud`` dist.
8 changes: 7 additions & 1 deletion src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-gcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@

from PyInstaller.utils.hooks import copy_metadata

datas = copy_metadata('gcloud')
# This hook was written for `gcloud` - https://pypi.org/project/gcloud
# Suppress package-not-found errors when the hook is triggered by `gcloud` namespace package from `gcloud-aio-*` and
# `gcloud-rest-*˙ dists (https://github.com/talkiq/gcloud-aio).
try:
datas = copy_metadata('gcloud')
except Exception:
pass

0 comments on commit ccc5f7d

Please sign in to comment.