From b2855e740fae5f0613eddb52fb79aab68306fbbd Mon Sep 17 00:00:00 2001 From: Dave Tapley Date: Thu, 15 Feb 2024 14:00:05 -0700 Subject: [PATCH] hooks: add hook for falcon --- news/703.new.rst | 1 + requirements-test-libraries.txt | 1 + .../hooks/stdhooks/hook-falcon.py | 27 +++++++++++++++++++ .../tests/test_libraries.py | 8 ++++++ 4 files changed, 37 insertions(+) create mode 100644 news/703.new.rst create mode 100644 src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-falcon.py diff --git a/news/703.new.rst b/news/703.new.rst new file mode 100644 index 000000000..f437c2e70 --- /dev/null +++ b/news/703.new.rst @@ -0,0 +1 @@ +Add hook for ``falcon``, which has hidden imports. \ No newline at end of file diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 1268fb44f..94d055595 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -31,6 +31,7 @@ discid==1.2.0; sys_platform != 'win32' eth_typing==4.0.0 eth_utils==3.0.0 fabric==3.2.2 +falcon==3.1.3 fiona==1.9.5; sys_platform != 'win32' folium==0.15.1 ffpyplayer==4.5.1 diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-falcon.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-falcon.py new file mode 100644 index 000000000..3c23ae3e8 --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-falcon.py @@ -0,0 +1,27 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2024 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 = [ + 'cgi', + 'falcon.app_helpers', + 'falcon.forwarded', + 'falcon.media', + 'falcon.request_helpers', + 'falcon.responders', + 'falcon.response_helpers', + 'falcon.routing', + 'falcon.vendor.mimeparse', + 'falcon.vendor', + 'uuid', + 'xml.etree.ElementTree', + 'xml.etree' +] diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index eec3cc3ed..daedbcab6 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -1905,3 +1905,11 @@ def test_osgeo(pyi_builder): sr.ImportFromEPSG(4326) assert(sr.EPSGTreatsAsLatLong()) """) + + +@importorskip('falcon') +def test_falcon(pyi_builder): + # https://github.com/falconry/falcon/blob/v3.1.3/examples/things.py + pyi_builder.test_source(""" + import falcon + """)