diff --git a/src/ifcpatch/__init__.py b/src/ifcpatch/__init__.py index 0632f90775..1af72f9bf0 100644 --- a/src/ifcpatch/__init__.py +++ b/src/ifcpatch/__init__.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# This can be packaged with `pyinstaller --onefile --clean --icon=icon.ico ifcpatch.py` +# This can be packaged into one executable with ./make.py import ifcopenshell import logging diff --git a/src/ifcpatch/make.py b/src/ifcpatch/make.py new file mode 100644 index 0000000000..a2a9da0b9a --- /dev/null +++ b/src/ifcpatch/make.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import os +import subprocess + +# add hidden imports in recipes here +HIDDEN_IMPORTS = [ + "ifcopenshell.util.selector", + "ifcopenshell.util.element", + "ifcopenshell.util.schema", + "toposort", +] + + +def main(): + hiddenimport_args = " ".join('--hiddenimport "{}"'.format(imp) for imp in HIDDEN_IMPORTS) + cmd = 'pyinstaller ./__init__.py --onefile --clean --add-data ".{}ifcpatch" {}'.format( + os.pathsep, hiddenimport_args + ) + subprocess.check_output(cmd, shell=True) + + +if __name__ == "__main__": + main()