From d11710ba7f735d13390be0a77c408ea03d890f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Thu, 1 Jun 2023 16:30:31 +0200 Subject: [PATCH 1/2] Add community requested dependencies --- package/cxfreeze/cx_setup.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/package/cxfreeze/cx_setup.py b/package/cxfreeze/cx_setup.py index c009579e6..bfee1a0eb 100644 --- a/package/cxfreeze/cx_setup.py +++ b/package/cxfreeze/cx_setup.py @@ -67,7 +67,7 @@ includes = [] # This module basically does not work with frozen versions -excludes.append("multiprocessing") +#excludes.append("multiprocessing") #some standard encodings #includes.append('encodings.ascii') @@ -204,7 +204,33 @@ def dummy_hook(*var, **kw): special_modules += [os.path.dirname(collections.__file__)] # no scipy (huge package not used by PyMca) -excludes += ["scipy"] +#excludes += ["scipy"] +# community requested modules +try: + import scipy + special_modules.append(os.path.dirname(scipy.__file__)) +except ImportError: + print("scipy not available, not added to the frozen executables") + +try: + import sklearn + import threadpoolctl + import joblib + import prompt_toolkit + #special_modules.append(os.path.dirname(sklearn.__file__)) + includes.append("sklearn") + special_modules.append(os.path.dirname(joblib.__file__)) + special_modules.append(threadpoolctl.__file__) + special_modules.append(os.path.dirname(prompt_toolkit.__file__)) +except ImportError: + print("scikit-learn not available, not added to the frozen executables") + sklearn = None + +try: + import umap + special_modules.append(os.path.dirname(umap.__file__)) +except ImportError: + print("umap not available, not added to the frozen executables") # give some time to read the output time.sleep(2) @@ -241,6 +267,9 @@ def dummy_hook(*var, **kw): "zip_exclude_packages":["*"]} #"compressed": True, } +if sklearn: + build_options["include_msvcr"] = True + if sys.platform.startswith("darwin") and cxVersion not in ["6.11.1"]: # something got wrong starting with cx_Freeze 6.12.0 # see https://github.com/marcelotduarte/cx_Freeze/issues/1671 From b352ae4230160de71097956a6aa1b519ca400591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=2E=20Armando=20Sol=C3=A9?= Date: Tue, 6 Jun 2023 09:39:04 +0200 Subject: [PATCH 2/2] umap-learn instead of umap --- package/cxfreeze/cx_setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/cxfreeze/cx_setup.py b/package/cxfreeze/cx_setup.py index bfee1a0eb..f929f2b85 100644 --- a/package/cxfreeze/cx_setup.py +++ b/package/cxfreeze/cx_setup.py @@ -228,9 +228,11 @@ def dummy_hook(*var, **kw): try: import umap - special_modules.append(os.path.dirname(umap.__file__)) + import pynndescent + includes.append("umap") + special_modules.append(os.path.dirname(pynndescent.__file__)) except ImportError: - print("umap not available, not added to the frozen executables") + print("umap-learn not available, not added to the frozen executables") # give some time to read the output time.sleep(2)