From b86a9c133d468363c63ad0cb40edc03ad1269275 Mon Sep 17 00:00:00 2001 From: Matthew Vine Date: Mon, 29 Jul 2024 07:37:25 -0400 Subject: [PATCH 1/4] feat: add hook for cmocean --- .../stdhooks/hook-cmocean.py | 15 +++++++++++++++ tests/test_libraries.py | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 _pyinstaller_hooks_contrib/stdhooks/hook-cmocean.py 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/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 + """) From 7ae0918eb30811dde59d6de404029c0520626002 Mon Sep 17 00:00:00 2001 From: Matthew Vine Date: Mon, 29 Jul 2024 07:45:12 -0400 Subject: [PATCH 2/4] chore: add cmocean to test requirements --- requirements-test-libraries.txt | 1 + 1 file changed, 1 insertion(+) 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 From 34a652e02d8be89326c6f6213bf5022c419b3c0c Mon Sep 17 00:00:00 2001 From: Matthew Vine Date: Mon, 29 Jul 2024 07:51:11 -0400 Subject: [PATCH 3/4] docs: add new entry for cmocean --- news/769.new.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/769.new.rst diff --git a/news/769.new.rst b/news/769.new.rst new file mode 100644 index 000000000..c745bd424 --- /dev/null +++ b/news/769.new.rst @@ -0,0 +1 @@ +Add a hook for ``cmocean``, which has a text data files. From 6542e94fb5e7fc63a842b178617816c50b11a79e Mon Sep 17 00:00:00 2001 From: Matthew Vine Date: Mon, 29 Jul 2024 07:52:43 -0400 Subject: [PATCH 4/4] docs: grammar error for cmocean --- news/769.new.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/769.new.rst b/news/769.new.rst index c745bd424..bf4fee022 100644 --- a/news/769.new.rst +++ b/news/769.new.rst @@ -1 +1 @@ -Add a hook for ``cmocean``, which has a text data files. +Add a hook for ``cmocean``, which has text data files.