Skip to content

Commit

Permalink
organization improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
norton120 committed Dec 9, 2024
1 parent e8ce928 commit 3e17a7e
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,14 @@ downloads/
eggs#letta/letta-server:0.3.7
**/**/.eggs/
MANIFEST
**/**/*.dmg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
!installable_apps/letta.spec
!installable_apps/*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
import darkdetect

from installable_logger import get_logger
from .installable_logger import get_logger

logger = get_logger(__name__)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import asyncio

from letta.settings import settings
from installable_image import InstallableImage
from installable_logger import get_logger
from installable_apps.desktop_application.installable_image import InstallableImage
from installable_apps.desktop_application.installable_logger import get_logger

logger = get_logger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from letta.server.rest_api.app import app as letta_app
from letta.server.constants import REST_DEFAULT_PORT

from server import ThreadedServer
from .server import ThreadedServer
from logserver.main import app as log_app
from tray import Tray
from installable_logger import get_logger
from .tray import Tray
from .installable_logger import get_logger

logger = get_logger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pystray import Icon, Menu, MenuItem
from PIL import Image

from installable_image import InstallableImage
from .installable_image import InstallableImage

class Tray:
icon_image: "Path"
Expand Down
17 changes: 8 additions & 9 deletions installable_apps/dmg_packager.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#!/bin/bash

# build the app for distribution
pyinstaller letta.spec
pyinstaller macos.spec

# fix for known silent exec fail from https://github.com/pyinstaller/pyinstaller/issues/5154#issuecomment-2508011279
APP_NAME="letta"
APP_VERSION=$( python -c "from importlib.metadata import version; print(version('letta'))")
BUILD_ARCH=$(uname -m)
WORKDIR=dist/$APP_NAME.app/Contents/MacOS
mv $WORKDIR/$APP_NAME $WORKDIR/${APP_NAME}_cli
# fix for known silent exec fail from https://github.com/pyinstaller/pyinstaller/issues/5154#issuecomment-2508011279
WORKDIR=dist/letta.app/Contents/MacOS
mv $WORKDIR/letta $WORKDIR/letta_cli

cat << EOF > $WORKDIR/$APP_NAME
cat << EOF > $WORKDIR/letta
#!/bin/bash
# This is the launcher for OSX, this way the app will be opened
# when you double click it from the apps folder
open -n /Applications/${APP_NAME}.app/Contents/MacOS/${APP_NAME}_cli
open -n /Applications/letta.app/Contents/MacOS/letta_cli
EOF

chmod +x $WORKDIR/$APP_NAME
chmod +x $WORKDIR/letta

mkdir dist/package
cp -r dist/$APP_NAME.app dist/package
cp -r dist/letta.app dist/package

# Create the .dmg file
create-dmg --volname "Letta Installer" --window-size 800 400 --icon-size 100 --background "assets/installer_background.png" --icon letta.app 200 200 --hide-extension letta.app --app-drop-link 600 185 "Letta-Installer-${APP_VERSION}-${BUILD_ARCH}.dmg" dist/package
4 changes: 2 additions & 2 deletions installable_apps/letta.spec → installable_apps/macos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


a = Analysis(
['startup.py'],
['desktop_application/startup.py'],
pathex=[],
binaries=[
('venv/lib/python3.12/site-packages/pgserver/pginstall', 'pgserver/pginstall')
Expand All @@ -14,7 +14,7 @@ a = Analysis(
('venv/lib/python3.12/site-packages/letta/prompts/system', 'letta/prompts/system'),
('venv/lib/python3.12/site-packages/letta/functions/function_sets', 'letta/functions/function_sets'),
('assets','assets'),
('logserver/templates','logserver/templates'),
('desktop_application/logserver/templates','logserver/templates'),

],
hiddenimports=[],
Expand Down

0 comments on commit 3e17a7e

Please sign in to comment.