diff --git a/.github/workflows/build_exe.yml b/.github/workflows/build_exe.yml index e679f1ad..e9799859 100644 --- a/.github/workflows/build_exe.yml +++ b/.github/workflows/build_exe.yml @@ -29,26 +29,26 @@ jobs: artifact_name: windows os: windows-2022 version_command: icacls "VERSION" /grant Everyone:F /T /C /Q - move_command: move dist\mangotango.exe dist\mangotango_windows.exe - sha_command: pwsh -c "Get-FileHash -Algorithm SHA1 dist\mangotango_windows.exe | Format-Table Hash -HideTableHeaders > dist\mangotango_windows.exe.sha1" + move_command: move dist\cibmangotree.exe dist\cibmangotree_windows.exe + sha_command: pwsh -c "Get-FileHash -Algorithm SHA1 dist\cibmangotree_windows.exe | Format-Table Hash -HideTableHeaders > dist\cibmangotree_windows.exe.sha1" list_command: dir dist - check_command: dist\mangotango_windows.exe --noop + check_command: dist\cibmangotree_windows.exe --noop - platform_name: MacOS (x86) artifact_name: macos-x86 os: macos-13 - move_command: mv dist/mangotango dist/mangotango_macos-x86 - sha_command: shasum -a 1 dist/mangotango_macos-x86 > dist/mangotango_macos-x86.sha1 - sha_command_pkg: shasum -a 1 dist/mangotango_macos-x86.pkg > dist/mangotango_macos-x86.pkg.sha1 + move_command: mv dist/cibmangotree dist/cibmangotree_macos-x86 + sha_command: shasum -a 1 dist/cibmangotree_macos-x86 > dist/cibmangotree_macos-x86.sha1 + sha_command_pkg: shasum -a 1 dist/cibmangotree_macos-x86.pkg > dist/cibmangotree_macos-x86.pkg.sha1 list_command: ls -ll dist - check_command: dist/mangotango_macos-x86 --noop + check_command: dist/cibmangotree_macos-x86 --noop - platform_name: MacOS (arm64) artifact_name: macos-arm64 os: macos-15 - move_command: mv dist/mangotango dist/mangotango_macos-arm64 - sha_command: shasum -a 1 dist/mangotango_macos-arm64 > dist/mangotango_macos-arm64.sha1 - sha_command_pkg: shasum -a 1 dist/mangotango_macos-arm64.pkg > dist/mangotango_macos-arm64.pkg.sha1 + move_command: mv dist/cibmangotree dist/cibmangotree_macos-arm64 + sha_command: shasum -a 1 dist/cibmangotree_macos-arm64 > dist/cibmangotree_macos-arm64.sha1 + sha_command_pkg: shasum -a 1 dist/cibmangotree_macos-arm64.pkg > dist/cibmangotree_macos-arm64.pkg.sha1 list_command: ls -ll dist - check_command: dist/mangotango_macos-arm64 --noop + check_command: dist/cibmangotree_macos-arm64 --noop name: Build ${{ matrix.platform_name }} runs-on: ${{ matrix.os }} @@ -130,13 +130,13 @@ jobs: APPLE_INST_CERT_ID: ${{secrets.APPLE_INST_CERT_ID}} APPLE_KEYCHAIN_PASS: ${{secrets.APPLE_KEY_PASS}} run: | - mkdir -p /tmp/mangotango/ - ditto dist/mangotango_${{matrix.artifact_name}} /tmp/mangotango/mangotango - chmod +x /tmp/mangotango/mangotango + mkdir -p /tmp/cibmangotree/ + ditto dist/cibmangotree_${{matrix.artifact_name}} /tmp/cibmangotree/cibmangotree + chmod +x /tmp/cibmangotree/cibmangotree security unlock-keychain -p $APPLE_KEYCHAIN_PASS build.keychain security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$APPLE_KEYCHAIN_PASS" build.keychain security find-identity -v -p codesigning build.keychain - pkgbuild --identifier "org.mangotango.cli" --timestamp --root /tmp/mangotango --install-location /Applications "./dist/mangotango_${{matrix.artifact_name}}_signed.pkg" --sign "$APPLE_INST_CERT_ID" + pkgbuild --identifier "org.cibmangotree.cli" --timestamp --root /tmp/cibmangotree --install-location /Applications "./dist/cibmangotree_${{matrix.artifact_name}}_signed.pkg" --sign "$APPLE_INST_CERT_ID" - name: Notarize Mac package if: runner.os == 'macOS' && inputs.is_release @@ -144,19 +144,19 @@ jobs: APPLE_DEV_EMAIL: ${{secrets.APPLE_DEV_EMAIL}} APPLE_TEAM_ID: ${{secrets.TEAM_ID}} APP_SPEC_PASS: ${{secrets.APP_SPEC_PASS}} - run: xcrun notarytool submit dist/mangotango_${{matrix.artifact_name}}_signed.pkg --apple-id $APPLE_DEV_EMAIL --team-id $APPLE_TEAM_ID --password $APP_SPEC_PASS --wait + run: xcrun notarytool submit dist/cibmangotree_${{matrix.artifact_name}}_signed.pkg --apple-id $APPLE_DEV_EMAIL --team-id $APPLE_TEAM_ID --password $APP_SPEC_PASS --wait - name: Staple the notarization ticket if: runner.os == 'macOS' && inputs.is_release - run: xcrun stapler staple dist/mangotango_${{matrix.artifact_name}}_signed.pkg + run: xcrun stapler staple dist/cibmangotree_${{matrix.artifact_name}}_signed.pkg - name: Clean up macOS Artifacts if: runner.os == 'macOS' && inputs.is_release run: | - rm -rf /tmp/mangotango - rm -rf dist/mangotango_${{matrix.artifact_name}} - rm -rf dist/mangotango_${{matrix.artifact_name}}.pkg - mv dist/mangotango_${{matrix.artifact_name}}_signed.pkg dist/mangotango_${{matrix.artifact_name}}.pkg + rm -rf /tmp/cibmangotree + rm -rf dist/cibmangotree_${{matrix.artifact_name}} + rm -rf dist/cibmangotree_${{matrix.artifact_name}}.pkg + mv dist/cibmangotree_${{matrix.artifact_name}}_signed.pkg dist/cibmangotree_${{matrix.artifact_name}}.pkg - name: Compute the SHA1 hashsum for macOS .pkg if: runner.os == 'macOS' && inputs.is_release diff --git a/mangotango.py b/cibmangotree.py similarity index 69% rename from mangotango.py rename to cibmangotree.py index 3dfd0812..be92b7be 100644 --- a/mangotango.py +++ b/cibmangotree.py @@ -4,14 +4,10 @@ from multiprocessing import freeze_support from pathlib import Path -from analyzers import suite -from app import App, AppContext -from app.logger import setup_logging -from components import ViewContext, main_menu, splash -from meta import get_version -from storage import Storage +from rich.console import Console +from rich.text import Text + from terminal_tools import enable_windows_ansi_support -from terminal_tools.inception import TerminalContext if __name__ == "__main__": freeze_support() @@ -38,6 +34,21 @@ print("No-op flag detected. Exiting successfully.") sys.exit(0) + # Show loading message early + console = Console() + loading_msg = Text("🥭 CIB Mango Tree is starting", style="orange1 bold") + loading_msg.append("... This may take a moment.", style="dim") + console.print(loading_msg) + + # Import heavy modules after loading message + from analyzers import suite + from app import App, AppContext + from app.logger import setup_logging + from components import ViewContext, main_menu, splash + from meta import get_version + from storage import Storage + from terminal_tools.inception import TerminalContext + # Initialize storage storage = Storage(app_name="MangoTango", app_author="Civic Tech DC") @@ -50,7 +61,7 @@ # Get logger for main module logger = logging.getLogger(__name__) logger.info( - "Starting Mango Tango CLI application", + "Starting CIB Mango Tree application", extra={"log_level": args.log_level, "log_file": str(log_file_path)}, ) diff --git a/pyinstaller.spec b/pyinstaller.spec index 5956ac8c..3adb1fa3 100644 --- a/pyinstaller.spec +++ b/pyinstaller.spec @@ -2,7 +2,7 @@ # main.spec # This file tells PyInstaller how to bundle your application from PyInstaller.utils.hooks import copy_metadata -from PyInstaller.building.api import EXE,PYZ +from PyInstaller.building.api import EXE, PYZ from PyInstaller.building.build_main import Analysis import sys import os @@ -21,7 +21,7 @@ if site_packages_path is None: raise RuntimeError("The site-packages directory could not be found. Please setup the python envrionment correctly and try again...") a = Analysis( - ['mangotango.py'], # Entry point + ['cibmangotree.py'], # Entry point pathex=['.'], # Ensure all paths are correctly included binaries=[], datas=[ @@ -88,10 +88,10 @@ if sys.platform == "darwin": a.binaries, a.zipfiles, a.datas, - name='mangotango', # The name of the executable + name='cibmangotree', # The name of the executable debug=False, strip=True, - upx=True, # You can set this to False if you don’t want UPX compression + upx=True, # You can set this to False if you don't want UPX compression console=True, # Set to False if you don't want a console window entitlements_file="./mango.entitlements", codesign_identity=os.getenv('APPLE_APP_CERT_ID'), @@ -103,9 +103,9 @@ else: a.binaries, a.zipfiles, a.datas, - name='mangotango', # The name of the executable + name='cibmangotree', # The name of the executable debug=False, strip=False, - upx=True, # You can set this to False if you don’t want UPX compression - console=True # Set to False if you don't want a console window + upx=True, # You can set this to False if you don't want UPX compression + console=True, # Set to False if you don't want a console window )