diff --git a/news/579.new.rst b/news/579.new.rst new file mode 100644 index 000000000..ef5199f8b --- /dev/null +++ b/news/579.new.rst @@ -0,0 +1 @@ +Add hook for ``graphql_query`` diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 7bac7b38f..ecceca8c6 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -31,6 +31,7 @@ fiona==1.9.3; sys_platform != 'win32' folium==0.14.0 ffpyplayer==4.5.0 geopandas==0.13.0; python_version >= '3.8' and sys_platform != 'win32' +graphql-query==1.0.3 python-gitlab==3.14.0 h5py==3.8.0; python_version >= '3.7' humanize==4.6.0 diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-graphql_query.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-graphql_query.py new file mode 100755 index 000000000..6de96df19 --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-graphql_query.py @@ -0,0 +1,17 @@ +#----------------------------------------------------------------------------- +# Copyright (c) 2005-2023, PyInstaller Development Team. +# +# Distributed under the terms of the GNU General Public License (version 2 +# or later) with exception for distributing the bootloader. +# +# The full license is in the file COPYING.txt, distributed with this software. +# +# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) +#----------------------------------------------------------------------------- +""" +PyInstaller hook file for graphql_query. Tested with version 1.0.3. +""" + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files('graphql_query.templates') diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index a9607d1e7..ff188aaa1 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -1214,6 +1214,14 @@ def test_gitlab(pyi_builder): import gitlab """) +@importorskip('graphql_query') +def test_graphql_query(pyi_builder): + pyi_builder.test_source(""" + from graphql_query import Operation, Query + hero = Query(name="hero", fields=["name"]) + operation = Operation(type="query", queries=[hero]) + print(operation.render()) + """) @importorskip('shapely') def test_shapely(pyi_builder):