Skip to content

Commit 0a92889

Browse files
committed
Reorganize build files and add model capabilities data
- Moved PyInstaller spec files from root to build/ directory structure - Updated GitHub Actions workflows to reference new spec file paths - Added model_capabilities.json with thinking model behavior classification - Removed deprecated build scripts and old thinking detection results - Updated .gitignore to track build config while ignoring dist outputs
1 parent 643280b commit 0a92889

File tree

10 files changed

+74
-25
lines changed

10 files changed

+74
-25
lines changed

.github/workflows/build-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Build executable
4444
run: |
45-
pyinstaller --clean TranslateBook-macOS.spec
45+
pyinstaller --clean build/macos/TranslateBook-macOS.spec
4646
4747
- name: Get executable info
4848
id: exe_info

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
- name: Build executable
3333
run: |
34-
pyinstaller --clean TranslateBook.spec
34+
pyinstaller --clean build/windows/TranslateBook.spec
3535
3636
- name: Get executable size
3737
id: exe_info

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ CLAUDE.md
99
.env
1010
/venv
1111
build_installer.bat
12-
build/
12+
build/dist/
13+
build/TranslateBookWithLLM/
1314
/dist
1415
/wiki/
1516
.wiki_repo/

build/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build Scripts
2+
3+
This directory contains all build-related files for creating standalone executables.
4+
5+
## Structure
6+
7+
```
8+
build/
9+
├── windows/ # Windows build files
10+
│ ├── TranslateBook.spec # PyInstaller spec for Windows
11+
│ ├── build_exe.bat # Windows build script
12+
│ └── install_chatterbox.bat # Chatterbox TTS installer
13+
├── macos/ # macOS build files
14+
│ ├── TranslateBook-macOS.spec # PyInstaller spec for macOS
15+
│ └── build_macos.sh # macOS build script
16+
└── README.md # This file
17+
```
18+
19+
## Building Executables
20+
21+
### Windows
22+
23+
```bash
24+
cd build/windows
25+
build_exe.bat
26+
```
27+
28+
The executable will be created at: `../../dist/TranslateBook.exe`
29+
30+
### macOS
31+
32+
```bash
33+
cd build/macos
34+
./build_macos.sh
35+
```
36+
37+
The executable will be created at: `../../dist/TranslateBook`
38+
39+
## GitHub Workflows
40+
41+
The GitHub Actions workflows automatically use these files:
42+
- [.github/workflows/build-windows.yml](../../.github/workflows/build-windows.yml)
43+
- [.github/workflows/build-macos.yml](../../.github/workflows/build-macos.yml)
44+
45+
## Output
46+
47+
All builds output to the root `dist/` directory, which is git-ignored.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ tiktoken_ext_dir = os.path.dirname(tiktoken_ext.openai_public.__file__)
99

1010
# Prepare datas list
1111
datas_list = [
12-
('src/web/static', 'src/web/static'),
13-
('src/web/templates', 'src/web/templates'),
14-
('src', 'src'),
15-
('.env.example', '.'),
12+
('../../src/web/static', 'src/web/static'),
13+
('../../src/web/templates', 'src/web/templates'),
14+
('../../src', 'src'),
15+
('../../.env.example', '.'),
1616
]
1717

1818
# Add tiktoken_ext if directory exists
1919
if os.path.exists(tiktoken_ext_dir):
2020
datas_list.append((tiktoken_ext_dir, 'tiktoken_ext/openai_public'))
2121

2222
a = Analysis(
23-
['launcher.py'],
23+
['../../launcher.py'],
2424
pathex=[],
2525
binaries=[],
2626
datas=datas_list,

build_macos.sh renamed to build/macos/build_macos.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ echo "============================================"
1010
echo ""
1111

1212
# Check if virtual environment exists
13-
if [ ! -d "venv" ]; then
13+
if [ ! -d "../../venv" ]; then
1414
echo "[ERROR] Virtual environment not found"
1515
echo "Please create one first:"
1616
echo " python3 -m venv venv"
@@ -21,7 +21,7 @@ fi
2121

2222
# Activate virtual environment
2323
echo "[1/4] Activating virtual environment..."
24-
source venv/bin/activate
24+
source ../../venv/bin/activate
2525

2626
# Install PyInstaller if not already installed
2727
echo "[2/4] Checking PyInstaller installation..."
@@ -33,7 +33,7 @@ echo "[OK] PyInstaller ready"
3333

3434
# Clean previous builds
3535
echo "[3/4] Cleaning previous builds..."
36-
rm -rf dist build
36+
rm -rf ../../dist ../dist ../TranslateBookWithLLM
3737
echo "[OK] Cleaned"
3838

3939
# Build executable
@@ -53,11 +53,11 @@ echo "============================================"
5353
echo "Build Complete!"
5454
echo "============================================"
5555
echo ""
56-
echo "Executable location: dist/TranslateBook"
56+
echo "Executable location: ../../dist/TranslateBook"
5757

5858
# Get file size
59-
if [ -f "dist/TranslateBook" ]; then
60-
SIZE=$(ls -lh dist/TranslateBook | awk '{print $5}')
59+
if [ -f "../../dist/TranslateBook" ]; then
60+
SIZE=$(ls -lh ../../dist/TranslateBook | awk '{print $5}')
6161
echo "File size: $SIZE"
6262
fi
6363

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ tiktoken_ext_dir = os.path.dirname(tiktoken_ext.openai_public.__file__)
99

1010
# Prepare datas list
1111
datas_list = [
12-
('src/web/static', 'src/web/static'),
13-
('src/web/templates', 'src/web/templates'),
14-
('src', 'src'),
15-
('.env.example', '.'),
12+
('../../src/web/static', 'src/web/static'),
13+
('../../src/web/templates', 'src/web/templates'),
14+
('../../src', 'src'),
15+
('../../.env.example', '.'),
1616
]
1717

1818
# Add tiktoken_ext if directory exists
1919
if os.path.exists(tiktoken_ext_dir):
2020
datas_list.append((tiktoken_ext_dir, 'tiktoken_ext/openai_public'))
2121

2222
a = Analysis(
23-
['launcher.py'],
23+
['../../launcher.py'],
2424
pathex=[],
2525
binaries=[],
2626
datas=datas_list,

build_exe.bat renamed to build/windows/build_exe.bat

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ echo ============================================
1010
echo.
1111

1212
REM Check if virtual environment exists
13-
if not exist "venv" (
13+
if not exist "..\..\venv" (
1414
echo [ERROR] Virtual environment not found
1515
echo Please run start.bat first to set up the environment
1616
pause
@@ -19,7 +19,7 @@ if not exist "venv" (
1919

2020
REM Activate virtual environment
2121
echo [1/4] Activating virtual environment...
22-
call venv\Scripts\activate.bat
22+
call ..\..\venv\Scripts\activate.bat
2323

2424
REM Install PyInstaller if not already installed
2525
echo [2/4] Checking PyInstaller installation...
@@ -32,8 +32,9 @@ echo [OK] PyInstaller ready
3232

3333
REM Clean previous builds
3434
echo [3/4] Cleaning previous builds...
35-
if exist "dist" rmdir /s /q dist
36-
if exist "build" rmdir /s /q build
35+
if exist "..\..\dist" rmdir /s /q ..\..\dist
36+
if exist "..\dist" rmdir /s /q ..\dist
37+
if exist "..\TranslateBookWithLLM" rmdir /s /q ..\TranslateBookWithLLM
3738
echo [OK] Cleaned
3839

3940
REM Build executable
@@ -54,9 +55,9 @@ echo ============================================
5455
echo Build Complete!
5556
echo ============================================
5657
echo.
57-
echo Executable location: dist\TranslateBook.exe
58+
echo Executable location: ..\..\dist\TranslateBook.exe
5859
echo File size:
59-
for %%A in (dist\TranslateBook.exe) do echo %%~zA bytes (approx. %%~zA / 1048576 MB)
60+
for %%A in (..\..\dist\TranslateBook.exe) do echo %%~zA bytes (approx. %%~zA / 1048576 MB)
6061
echo.
6162
echo You can now distribute this single .exe file
6263
echo Users need to have Ollama installed separately
File renamed without changes.

0 commit comments

Comments
 (0)