summaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py
diff options
context:
space:
mode:
authorblackhao <13851610112@163.com>2025-08-22 02:51:50 -0500
committerblackhao <13851610112@163.com>2025-08-22 02:51:50 -0500
commit4aab4087dc97906d0b9890035401175cdaab32d4 (patch)
tree4e2e9d88a711ec5b1cfa02e8ac72a55183b99123 /.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py
parentafa8f50d1d21c721dabcb31ad244610946ab65a3 (diff)
2.0
Diffstat (limited to '.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py')
-rw-r--r--.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py b/.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py
new file mode 100644
index 0000000..61c224b
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/numpy/_pyinstaller/hook-numpy.py
@@ -0,0 +1,36 @@
+"""This hook should collect all binary files and any hidden modules that numpy
+needs.
+
+Our (some-what inadequate) docs for writing PyInstaller hooks are kept here:
+https://pyinstaller.readthedocs.io/en/stable/hooks.html
+
+"""
+from PyInstaller.compat import is_pure_conda
+from PyInstaller.utils.hooks import collect_dynamic_libs
+
+# Collect all DLLs inside numpy's installation folder, dump them into built
+# app's root.
+binaries = collect_dynamic_libs("numpy", ".")
+
+# If using Conda without any non-conda virtual environment manager:
+if is_pure_conda:
+ # Assume running the NumPy from Conda-forge and collect it's DLLs from the
+ # communal Conda bin directory. DLLs from NumPy's dependencies must also be
+ # collected to capture MKL, OpenBlas, OpenMP, etc.
+ from PyInstaller.utils.hooks import conda_support
+ datas = conda_support.collect_dynamic_libs("numpy", dependencies=True)
+
+# Submodules PyInstaller cannot detect. `_dtype_ctypes` is only imported
+# from C and `_multiarray_tests` is used in tests (which are not packed).
+hiddenimports = ['numpy._core._dtype_ctypes', 'numpy._core._multiarray_tests']
+
+# Remove testing and building code and packages that are referenced throughout
+# NumPy but are not really dependencies.
+excludedimports = [
+ "scipy",
+ "pytest",
+ "f2py",
+ "setuptools",
+ "distutils",
+ "numpy.distutils",
+]