diff --git a/beempy-onedir.spec b/beempy-onedir.spec index e7c89089dfd76cc477a7cc2174be65926fb3ec2b..e6f8516a445e670a0f069c9fe25445aac0a6db43 100644 --- a/beempy-onedir.spec +++ b/beempy-onedir.spec @@ -4,17 +4,26 @@ import os import glob import platform from PyInstaller.utils.hooks import exec_statement +import websocket +from os.path import join, dirname, basename block_cipher = None os_name = platform.system() binaries = [] -data_files = [] +websocket_lib_path = dirname(websocket.__file__) +websocket_cacert_file_path = join(websocket_lib_path, 'cacert.pem') +analysis_data = [ + # For websocket library to find "cacert.pem" file, it must be in websocket + # directory inside of distribution directory. + # This line can be removed once PyInstaller adds hook-websocket.py + (websocket_cacert_file_path, join('.', basename(websocket_lib_path))) +] a = Analysis(['beem/cli.py'], pathex=['beem'], binaries=binaries, - datas=data_files, + datas=analysis_data, hiddenimports=['scrypt', 'websocket'], hookspath=[], runtime_hooks=[], diff --git a/beempy-onefile.spec b/beempy-onefile.spec index f1aa69adf1248931553f982447a0f78389f02711..53c0dcd5dfb7dad8b010384eb1cac30dfdd72e4f 100644 --- a/beempy-onefile.spec +++ b/beempy-onefile.spec @@ -4,17 +4,27 @@ import os import glob import platform from PyInstaller.utils.hooks import exec_statement +import websocket +from os.path import join, dirname, basename block_cipher = None os_name = platform.system() binaries = [] -data_files = [] +websocket_lib_path = dirname(websocket.__file__) +websocket_cacert_file_path = join(websocket_lib_path, 'cacert.pem') +analysis_data = [ + # For websocket library to find "cacert.pem" file, it must be in websocket + # directory inside of distribution directory. + # This line can be removed once PyInstaller adds hook-websocket.py + (websocket_cacert_file_path, join('.', basename(websocket_lib_path))) +] + a = Analysis(['beem/cli.py'], pathex=['beem'], binaries=binaries, - datas=data_files, + datas=analysis_data, hiddenimports=['scrypt', 'websocket'], hookspath=[], runtime_hooks=[],