forked from sortitionfoundation/stratification-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make PyInstaller bundle all necessary binaries for the mip library.
Note that the release command has an additional parameter, as detailed in the README. Addresses coin-or/python-mip#76, and will become obsolete when pyinstaller/pyinstaller#4762 makes it into the pyinstaller release.
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Ensures that PyInstaller copies the CBC binaries for the mip library. | ||
# See https://github.com/coin-or/python-mip/issues/76. | ||
# Should become obsolete once https://github.com/pyinstaller/pyinstaller/pull/4762 | ||
# gets merged and makes it into the pyinstaller release. | ||
|
||
import os | ||
from PyInstaller.utils.hooks import get_package_paths | ||
|
||
datas = [] | ||
_, mip_path = get_package_paths("mip") | ||
lib_path = os.path.join(mip_path, "libraries") | ||
|
||
for f in os.listdir(lib_path): | ||
if f.endswith(".so") or f.endswith(".dll") or f.endswith(".dylib"): | ||
datas.append((os.path.join(lib_path, f), "mip/libraries")) |