Portfolio binary bug fix (#2700)

* Removing unused dylib

* Deleting commented out code

* actually removing the binary

* refactoring
This commit is contained in:
James Simmons
2022-10-04 19:10:10 -04:00
committed by GitHub
parent 50e3053a45
commit d0c5c8e288

View File

@@ -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]