From d0c5c8e2880ac543e25b49432964ca3f74f13a5c Mon Sep 17 00:00:00 2001 From: James Simmons <53658028+simmonsj330@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:10:10 -0400 Subject: [PATCH] Portfolio binary bug fix (#2700) * Removing unused dylib * Deleting commented out code * actually removing the binary * refactoring --- build/pyinstaller/terminal.spec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/pyinstaller/terminal.spec b/build/pyinstaller/terminal.spec index 54d2495784d..e8d74953a70 100644 --- a/build/pyinstaller/terminal.spec +++ b/build/pyinstaller/terminal.spec @@ -1,5 +1,6 @@ # -*- mode: python ; coding: utf-8 -*- import os +import pathlib from dotenv import set_key @@ -8,6 +9,9 @@ from PyInstaller.building.api import PYZ, EXE, COLLECT from PyInstaller.building.splash import Splash from PyInstaller.building.build_main import Analysis + +# import subprocess + from openbb_terminal.loggers import get_commit_hash NAME = "OpenBBTerminal" @@ -19,6 +23,14 @@ build_type = ( # Local python environment packages folder pathex = os.path.join(os.path.dirname(os.__file__), "site-packages") +# Removing unused ARM64 binary +binary_to_remove = pathlib.Path( + os.path.join(pathex, "_scs_direct.cpython-39-darwin.so") +) +print("Removing ARM64 Binary: _scs_direct.cpython-39-darwin.so") +binary_to_remove.unlink(missing_ok=True) + + # Get latest commit commit_hash = get_commit_hash() build_assets_folder = os.path.join(os.getcwd(), "build", "pyinstaller") @@ -81,6 +93,7 @@ hidden_imports = [ "bson", ] + analysis_kwargs = dict( scripts=[os.path.join(os.getcwd(), "terminal.py")], pathex=[pathex, "."], @@ -120,6 +133,7 @@ exe_kwargs = dict( entitlements_file=None, ) + # Packaging settings if build_type == "onefile": exe_args += [a.binaries, a.zipfiles, a.datas]