Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/python-app-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
nix develop --command uv sync --extra dev
- name: Build executable
run: |
nix develop --command uv run python -m PyInstaller Wordweaver.spec
nix develop --command uv run python -m PyInstaller src/Wordweaver.spec
- name: Get version for macOS installer
id: version
run: |
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
if: runner.os == 'Windows'
- name: Build executable
run: |
uv run python -m PyInstaller Wordweaver.spec
uv run python -m PyInstaller src/Wordweaver.spec
- name: Build Windows installer
run: |
makensis src/wordweaver.nsi
Expand Down
87 changes: 87 additions & 0 deletions src/Wordweaver.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# -*- mode: python ; coding: utf-8 -*-

import sys
from pathlib import Path

block_cipher = None

# Platform-specific settings
if sys.platform == 'darwin':
icon_file = 'icons/wordweaver.icns'
elif sys.platform == 'win32':
icon_file = 'icons/wordweaver.ico'
else:
icon_file = 'icons/wordweaver.ico'

a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[
('VERSION', '.'),
('icons', 'icons'),
],
hiddenimports=[
'PyQt6',
'PyQt6.QtCore',
'PyQt6.QtGui',
'PyQt6.QtWidgets',
'platformdirs',
'pyperclip',
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding 'ipapy.ipachar' and potentially other ipapy submodules to the hiddenimports list. The code uses dynamic imports from ipapy (e.g., 'from ipapy import IPA_CHARS' inside a function in phonology.py) which PyInstaller's static analysis may not detect. This could cause runtime import errors in the bundled executable.

Suggested change
'pyperclip',
'pyperclip',
'ipapy',
'ipapy.ipachar',

Copilot uses AI. Check for mistakes.
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)

pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='Wordweaver',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon_file,
)

coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='Wordweaver',
)

# macOS app bundle
if sys.platform == 'darwin':
app = BUNDLE(
coll,
name='Wordweaver.app',
icon='icons/wordweaver.icns',
bundle_identifier='com.prestonhager.wordweaver',
info_plist={
'CFBundleShortVersionString': Path('VERSION').read_text().strip(),
'CFBundleVersion': Path('VERSION').read_text().strip(),
Comment on lines +82 to +83
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VERSION file is read twice when building the macOS bundle. Consider reading it once and reusing the value to improve efficiency and reduce potential for I/O errors. For example, store it in a variable at the top of the spec file: version = Path('VERSION').read_text().strip() and use that variable in the info_plist dictionary.

Copilot uses AI. Check for mistakes.
'NSHighResolutionCapable': True,
'LSMinimumSystemVersion': '10.13',
},
)