Skip to content

Commit

Permalink
Add a hook and test for sentry which has hidden imports for its integ…
Browse files Browse the repository at this point in the history
…rations (#7)
  • Loading branch information
SimonIT authored and Legorooj committed Jun 28, 2020
1 parent 8b53f79 commit 5c7091e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/7.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adding a hook for sentry which has hidden imports for its integrations
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pyusb==1.0.2
pyzmq==19.0.0
Unidecode==1.1.1
zeep==3.4.0
sentry-sdk==0.15.1

# ------------------- Python Version/Platform (OS) specifics
# These libraries only support python above 3.5
Expand Down
20 changes: 20 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-sentry_sdk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# ------------------------------------------------------------------
# Copyright (c) 2020 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
# ------------------------------------------------------------------

hiddenimports = ["sentry_sdk.integrations.stdlib",
"sentry_sdk.integrations.excepthook",
"sentry_sdk.integrations.dedupe",
"sentry_sdk.integrations.atexit",
"sentry_sdk.integrations.modules",
"sentry_sdk.integrations.argv",
"sentry_sdk.integrations.logging",
"sentry_sdk.integrations.threading"]
9 changes: 9 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,3 +278,12 @@ def test_pytest_runner(pyi_builder):
@importorskip('eel')
def test_eel(pyi_builder):
pyi_builder.test_source("import eel")


@importorskip('sentry_sdk')
def test_sentry(pyi_builder):
pyi_builder.test_source(
"""
import sentry_sdk
sentry_sdk.init()
""")

0 comments on commit 5c7091e

Please sign in to comment.