Skip to content

Commit

Permalink
Merge pull request #1006 from vasole/community
Browse files Browse the repository at this point in the history
Add community requested modules (if present)
  • Loading branch information
vasole committed Jun 6, 2023
2 parents da0b8b1 + b352ae4 commit ebacd4b
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions package/cxfreeze/cx_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -204,7 +204,35 @@ 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
import pynndescent
includes.append("umap")
special_modules.append(os.path.dirname(pynndescent.__file__))
except ImportError:
print("umap-learn not available, not added to the frozen executables")

# give some time to read the output
time.sleep(2)
Expand Down Expand Up @@ -241,6 +269,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
Expand Down

0 comments on commit ebacd4b

Please sign in to comment.