diff --git a/news/391.new.rst b/news/391.new.rst new file mode 100644 index 00000000..b1ec7bb4 --- /dev/null +++ b/news/391.new.rst @@ -0,0 +1 @@ +Add a hook for ``cassandra``, which has Cython files. \ No newline at end of file diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 5de331a3..c072a5fe 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -13,6 +13,7 @@ botocore==1.23.54 branca==0.4.2 cairocffi==1.3.0 CairoSVG==2.5.2 +cassandra-driver==3.25.0 cloudscraper==1.2.58 dash==2.1.0 dash-bootstrap-components==1.0.3 diff --git a/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cassandra.py b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cassandra.py new file mode 100644 index 00000000..97cd4c78 --- /dev/null +++ b/src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cassandra.py @@ -0,0 +1,22 @@ +# ------------------------------------------------------------------ +# Copyright (c) 2022 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 +# ------------------------------------------------------------------ +# +# A modern, feature-rich and highly-tunable Python client library for Apache Cassandra (2.1+) and +# DataStax Enterprise (4.7+) using exclusively Cassandra's binary protocol and Cassandra Query Language v3. +# +# http://datastax.github.io/python-driver/api/index.html +# +# Tested with cassandra-driver 3.25.0 + +from PyInstaller.utils.hooks import collect_submodules + +hiddenimports = collect_submodules('cassandra') diff --git a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py index 9a687abd..94fa87e7 100644 --- a/src/_pyinstaller_hooks_contrib/tests/test_libraries.py +++ b/src/_pyinstaller_hooks_contrib/tests/test_libraries.py @@ -1072,6 +1072,13 @@ def test_altair(pyi_builder): """) +@importorskip('cassandra') +def test_cassandra(pyi_builder): + pyi_builder.test_source(""" + import cassandra + """) + + @importorskip('gitlab') def test_gitlab(pyi_builder): pyi_builder.test_source("""