Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ aipython.toml
work/
client.crt

打包过程.md
macOS应用签名指南.md
entitlements.plist
sign_app.sh
get-pip.py
Binary file added aipyapp/aipy.icns
Binary file not shown.
24 changes: 24 additions & 0 deletions aipyapp_gui_launcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys

def log_debug(msg):
"""写入调试日志"""
log_path = os.path.expanduser("~/Desktop/aipyapp_debug.log")
with open(log_path, 'a', encoding='utf-8') as f:
f.write(f"{msg}\n")

# 记录启动信息
log_debug(f"启动时间: {__import__('datetime').datetime.now()}")
log_debug(f"Python executable: {sys.executable}")
log_debug(f"Python path: {sys.path}")
log_debug(f"Current directory: {os.getcwd()}")

try:
from aipyapp.__main__ import mainw
mainw()
except Exception as e:
import traceback
log_debug(f"Error: {e}")
log_debug(traceback.format_exc())
96 changes: 96 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
"""
This is a setup.py script for packaging the aipyapp application.
"""

from setuptools import setup
import os
import sys

# 确保py2app可用
try:
import py2app
except ImportError:
print("Error: py2app is not installed. Please install it with 'pip install py2app'")
sys.exit(1)

# 获取所有资源文件
def get_resource_files():
resource_files = []
res_dir = 'aipyapp'
for file in os.listdir(res_dir):
if os.path.isfile(os.path.join(res_dir, file)):
resource_files.append(os.path.join(res_dir, file))
return resource_files

# 只有在py2app命令时才使用这些选项
if 'py2app' in sys.argv:
extra_options = {
'app': ['aipyapp_gui_launcher.py'],
'data_files': [('res', get_resource_files())],
'options': {
'py2app': {
'argv_emulation': False,
'packages': [
'aipyapp',
'wx',
'matplotlib',
'rich',
'anthropic',
'PIL',
'loguru',
'dynaconf',
],
'includes': [
'pathlib',
'importlib',
'json',
'queue',
'threading',
'wx.adv',
'wx.html',
'wx.html2',
'matplotlib.backends.backend_wxagg',
'numpy',
'argparse',
'base64',
'mimetypes',
],
'excludes': [
'tkinter',
'PyQt5',
'PyQt6',
'PySide2',
'PySide6',
],
'frameworks': [],
'iconfile': './aipyapp/aipy.icns',
'plist': {
'CFBundleName': 'AiPy',
'CFBundleDisplayName': 'AiPy',
'CFBundleIdentifier': 'com.aipy.aipyapp',
'CFBundleVersion': '1.0.0',
'CFBundleShortVersionString': '1.0.0',
'NSHumanReadableCopyright': '© 2025 AiPy',
'NSHighResolutionCapable': True,
'CFBundleDocumentTypes': [],
'NSPrincipalClass': 'NSApplication',
},
'semi_standalone': False,
'site_packages': True,
'strip': False,
}
}
}
else:
extra_options = {}

setup(
name="AiPy",
version="0.1.27",
description="AiPy, Your AI is just like a drudge, Help earn money, Help slack off, Help find lover, anything goes.",
author="AiPy Team",
author_email="luol2@knownsec.com",
url="https://aipy.app",
packages=['aipyapp'],
**extra_options
)