-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
91 lines (84 loc) · 2.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import os
import shutil
from setuptools import setup, find_packages
# Remove existing build directory
build_dir = 'build'
if os.path.exists(build_dir):
shutil.rmtree(build_dir)
def find_library(name, brew_path):
lib_path = None
for root, dirs, files in os.walk(brew_path):
if f'{name}.dylib' in files:
lib_path = os.path.join(root, f'{name}.dylib')
break
if not lib_path:
raise ValueError(f"Could not find {name}.dylib. Please ensure it's installed via Homebrew.")
return lib_path
# Find required libraries
libffi_path = find_library('libffi', '/opt/homebrew/Cellar/libffi')
libssl_path = find_library('libssl', '/opt/homebrew/Cellar/openssl@3')
libcrypto_path = find_library('libcrypto', '/opt/homebrew/Cellar/openssl@3')
APP = ['whisperGPT.py']
DATA_FILES = [
('config', ['config/config.py', 'config/shortcuts.py', 'config/actions_config.py']),
('audio', ['audio/audio_processing.py', 'audio/sounds.py', 'audio/speak.py']),
('actions', ['actions/BaseAction.py', 'actions/simple_gpt_action.py', 'actions/transcribe.py', 'actions/translate.py']),
('prompts', ['prompts/prompts.py']),
('', ['main.py', 'utils.py', '.env']),
]
required_packages = [
'rumps', 'openai', 'pynput', 'pyaudio', 'pydub', 'simpleaudio', 'assemblyai', 'groq',
'langchain', 'langchain_openai', 'langchain_groq', 'charset_normalizer', 'chardet'
]
OPTIONS = {
'argv_emulation': True,
'packages': required_packages,
'includes': required_packages,
'excludes': ['PyQt6', 'PyInstaller'],
'frameworks': [libffi_path, libssl_path, libcrypto_path],
'resources': ['README.md', 'requirements.txt'],
'plist': {
'CFBundleName': 'WhisperGPT',
'CFBundleShortVersionString': '1.0.0',
'CFBundleVersion': '1.0.0',
'CFBundleIdentifier': 'com.yourdomain.WhisperGPT',
'NSHumanReadableCopyright': 'Copyright © 2023 Your Name',
'NSHighResolutionCapable': True,
'LSUIElement': True,
},
}
setup(
app=APP,
name='WhisperGPT',
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
install_requires=[
'assemblyai',
'groq',
'langchain',
'chardet',
'charset-normalizer',
'langchain-groq',
'langchain-openai',
'langsmith',
'numpy',
'openai',
#'playsound',
'pooch',
'PyAudio',
'pycparser',
'pydub',
'pynput',
'pyperclip',
'python-dotenv',
'regex',
'requests',
'rumps',
'scikit-learn',
'scipy',
'simpleaudio',
'tiktoken',
'tqdm',
],
)