|
@@ -38,15 +38,32 @@ echo Wheel build |
|
|
mv dist/inselect-*.whl .
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
+ # Modules to be excluded - .spec files read this env var
|
|
|
+ # See https://github.com/pyinstaller/pyinstaller/wiki/Recipe-remove-tkinter-tcl
|
|
|
+ # for details of excluding all of the tcl, tk, tkinter shat
|
|
|
+ export EXCLUDE_MODULES="2to3 elementtree FixTk PIL._imagingtk ssl tcl tk _tkinter tkinter Tkinter"
|
|
|
+
|
|
|
# Scripts that have additional requirements in their own spec files
|
|
|
- for script in inselect read_barcodes segment; do
|
|
|
+ for script in inselect read_barcodes; do
|
|
|
pyinstaller --clean $script.spec
|
|
|
done
|
|
|
|
|
|
- # Scripts for which the .spec file can be generated
|
|
|
- for script in export_metadata ingest save_crops; do
|
|
|
+ # Format excludes for pyinstaller command line
|
|
|
+ export EXCLUDE_MODULES=`python -c "print(' '.join('--exclude-module {0}'.format(e) for e in '$EXCLUDE_MODULES'.split(' ')))"`
|
|
|
+
|
|
|
+ # export_metadata uses neither cv2 nor numpy
|
|
|
+ pyinstaller --onefile --exclude-module cv2 --exclude-module numpy \
|
|
|
+ $EXCLUDE_MODULES inselect/scripts/export_metadata.py
|
|
|
+
|
|
|
+ pyinstaller --onefile $EXCLUDE_MODULES \
|
|
|
+ --hidden-import sklearn.neighbors.typedefs \
|
|
|
+ --hidden-import sklearn.neighbors.dist_metrics \
|
|
|
+ inselect/scripts/segment.py
|
|
|
+
|
|
|
+ # Other scripts
|
|
|
+ for script in ingest save_crops; do
|
|
|
rm -rf $script.spec
|
|
|
- pyinstaller --onefile --hidden-import numpy inselect/scripts/$script.py
|
|
|
+ pyinstaller --onefile $EXCLUDE_MODULES inselect/scripts/$script.py
|
|
|
done
|
|
|
|
|
|
# Add a few items to the PropertyList file generated by PyInstaller
|
|
|
0 comments on commit
0190758