Skip to content

Commit

Permalink
Added a PyInstaller hook for missing numpy file (#1083)
Browse files Browse the repository at this point in the history
* Added a PyInstaller hook for missing numpy file

* Update numpy pyinstaller hook

* Reformatted

* Fix dst path

* Reformatted
  • Loading branch information
gentlegiantJGC authored Aug 6, 2024
1 parent 7370cc8 commit e9f3ba8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions amulet_map_editor/__pyinstaller/hook-numpy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
import glob
import sys

import numpy

if sys.platform == "win32":
numpy_path = numpy.__path__[0]
numpy_lib_path = numpy_path + ".libs"

datas = [
(dll_path, "numpy.libs")
for dll_path in glob.glob(os.path.join(glob.escape(numpy_lib_path), "*.dll"))
] + [
(
pyd_path,
os.path.relpath(os.path.dirname(pyd_path), os.path.dirname(numpy_path)),
)
for pyd_path in glob.glob(
os.path.join(glob.escape(numpy.__path__[0]), "**", "*.pyd"), recursive=True
)
]

0 comments on commit e9f3ba8

Please sign in to comment.