Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
hook-numpy.py37 linesDownload Raw Back to _pyinstaller
1"""This hook should collect all binary files and any hidden modules that numpy
2needs.
3
4Our (some-what inadequate) docs for writing PyInstaller hooks are kept here:
5https://pyinstaller.readthedocs.io/en/stable/hooks.html
6
7"""
8from PyInstaller.compat import is_pure_conda
9from PyInstaller.utils.hooks import collect_dynamic_libs
10
11# Collect all DLLs inside numpy's installation folder, dump them into built
12# app's root.
13binaries = collect_dynamic_libs("numpy", ".")
14
15# If using Conda without any non-conda virtual environment manager:
16if is_pure_conda:
17    # Assume running the NumPy from Conda-forge and collect it's DLLs from the
18    # communal Conda bin directory. DLLs from NumPy's dependencies must also be
19    # collected to capture MKL, OpenBlas, OpenMP, etc.
20    from PyInstaller.utils.hooks import conda_support
21    datas = conda_support.collect_dynamic_libs("numpy", dependencies=True)
22
23# Submodules PyInstaller cannot detect.  `_dtype_ctypes` is only imported
24# from C and `_multiarray_tests` is used in tests (which are not packed).
25hiddenimports = ['numpy._core._dtype_ctypes', 'numpy._core._multiarray_tests']
26
27# Remove testing and building code and packages that are referenced throughout
28# NumPy but are not really dependencies.
29excludedimports = [
30    "scipy",
31    "pytest",
32    "f2py",
33    "setuptools",
34    "distutils",
35    "numpy.distutils",
36]
37 
codekingpro/portable-devtools · Team Ai