From 39ff6b5c893aeb6edcfea12e65ed7705dd7ee354 Mon Sep 17 00:00:00 2001 From: LlambiasMBP Date: Fri, 15 Nov 2024 14:42:42 +0100 Subject: [PATCH] add PyInstaller support --- pyproject.toml | 5 ++++- yucca/__init__.py | 7 +++++++ yucca/_pyinstaller/__init__.py | 0 yucca/_pyinstaller/hook-yucca.py | 4 ++++ yucca/modules/__init__.py | 3 --- 5 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 yucca/_pyinstaller/__init__.py create mode 100644 yucca/_pyinstaller/hook-yucca.py diff --git a/pyproject.toml b/pyproject.toml index d4422163..0dff5f21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "yucca" -version = "2.2.2" +version = "2.2.3" authors = [ { name="Sebastian Llambias", email="llambias@live.com" }, { name="Asbjørn Munk", email="9844416+asbjrnmunk@users.noreply.github.com" }, @@ -62,6 +62,9 @@ yucca_ensemble = 'yucca.pipeline.run.run_ensemble:main' "Homepage" = "https://github.com/sllambias/yucca" "Bug Tracker" = "https://github.com/sllambias/yucca/issues" +[project.entry-points.pyinstaller40] +hook-dirs = 'yucca:_pyinstaller_hooks_dir' + [build-system] requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/yucca/__init__.py b/yucca/__init__.py index 3f3c798a..b00e6083 100644 --- a/yucca/__init__.py +++ b/yucca/__init__.py @@ -1,3 +1,10 @@ import logging logging.getLogger().setLevel(logging.INFO) + + +# Tell PyInstaller where to find hook-yucca.py +def _pyinstaller_hooks_dir(): + from pathlib import Path + + return [str(Path(__file__).with_name("_pyinstaller").resolve())] diff --git a/yucca/_pyinstaller/__init__.py b/yucca/_pyinstaller/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/yucca/_pyinstaller/hook-yucca.py b/yucca/_pyinstaller/hook-yucca.py new file mode 100644 index 00000000..448a86b2 --- /dev/null +++ b/yucca/_pyinstaller/hook-yucca.py @@ -0,0 +1,4 @@ +from PyInstaller.utils.hooks import collect_data_files + + +datas = collect_data_files("yucca", include_py_files=True) diff --git a/yucca/modules/__init__.py b/yucca/modules/__init__.py index 3f3c798a..e69de29b 100644 --- a/yucca/modules/__init__.py +++ b/yucca/modules/__init__.py @@ -1,3 +0,0 @@ -import logging - -logging.getLogger().setLevel(logging.INFO)