diff --git a/_pyinstaller_hooks_contrib/stdhooks/hook-cmocean.py b/_pyinstaller_hooks_contrib/stdhooks/hook-cmocean.py new file mode 100644 index 000000000..d7201b502 --- /dev/null +++ b/_pyinstaller_hooks_contrib/stdhooks/hook-cmocean.py @@ -0,0 +1,15 @@ +# ------------------------------------------------------------------ +# 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, distributed with +# this software. +# +# SPDX-License-Identifier: GPL-2.0-or-later +# ------------------------------------------------------------------ + +from PyInstaller.utils.hooks import collect_data_files + +datas = collect_data_files("cmocean", subdir="rgb") diff --git a/news/769.new.rst b/news/769.new.rst new file mode 100644 index 000000000..bf4fee022 --- /dev/null +++ b/news/769.new.rst @@ -0,0 +1 @@ +Add a hook for ``cmocean``, which has text data files. diff --git a/requirements-test-libraries.txt b/requirements-test-libraries.txt index 89959bbc7..b577f38b1 100644 --- a/requirements-test-libraries.txt +++ b/requirements-test-libraries.txt @@ -20,6 +20,7 @@ cftime==1.6.4 charset_normalizer==3.3.2 cloudpickle==3.0.0 cloudscraper==1.2.71 +cmocean==4.0.3 # compliance-checker requires cf-units, so same constraints apply. compliance-checker==5.1.1; sys_platform != 'win32' cryptography==43.0.0 diff --git a/tests/test_libraries.py b/tests/test_libraries.py index 4f746b624..08e0eafba 100644 --- a/tests/test_libraries.py +++ b/tests/test_libraries.py @@ -2114,3 +2114,10 @@ def test_patoolib(pyi_builder): cmdlist = patoolib.get_archive_cmdlist_func(program, 'extract', archive_format) print(f"Cmdlist: {cmdlist}") """) + + +@importorskip('cmocean') +def test_cmocean(pyi_builder): + pyi_builder.test_source(""" + import cmocean + """)