This document describes how to build Wareflow Analysis from source, including creating a standalone Windows executable.
- Prerequisites
- Development Installation
- Building the Windows Executable
- Building on Other Platforms
- Running Tests
- Troubleshooting
- Python 3.10 or higher
- Git
- For Windows builds: Windows 10 or later
- For development: pip and virtualenv (or uv)
# Clone the repository
git clone https://github.com/wareflowx/was.git
cd wareflow-analysis
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest# Clone the repository
git clone https://github.com/wareflowx/was.git
cd wareflow-analysis
# Sync dependencies with uv
uv sync
# Run tests
uv run pytestThe Windows executable is built using PyInstaller. This creates a standalone .exe file that can be distributed without requiring Python installation.
pip install pyinstaller
pip install -e .# Build using the spec file
pyinstaller build/gui.spec --clean --noconfirmThis will create dist/Warehouse-GUI.exe.
# Check file size (should be 50-100 MB)
ls -lh dist/Warehouse-GUI.exe
# Generate SHA256 checksum
sha256sum dist/Warehouse-GUI.exe > dist/Warehouse-GUI.exe.sha256
# Run the executable
dist/Warehouse-GUI.exe# Run smoke tests against the built executable
pytest tests/integration/test_exe_smoke.py -vThe build configuration is stored in build/gui.spec. Key settings:
- Entry Point:
src/wareflow_analysis/gui/__main__.py - Output:
dist/Warehouse-GUI.exe - Icon:
build/icon.ico - Console: Disabled (windowed mode)
- UPX Compression: Enabled
To customize the build:
- Edit
build/gui.spec - Add/remove hidden imports if needed
- Update version info in
build/version_info.txt - Rebuild with
pyinstaller build/gui.spec --clean --noconfirm
PyInstaller can create macOS bundles, but this has not been tested:
pyinstaller build/gui.spec --windowedFor Linux, you can create an AppImage:
# Install pyinstaller
pip install pyinstaller
# Build
pyinstaller build/gui.spec --onefile
# The binary will be in dist/Note: CustomTkinter may have platform-specific limitations on Linux.
pytestpytest tests/unit/pytest tests/integration/pytest tests/gui/pytest --cov=wareflow_analysis --cov-report=htmlGitHub Actions automatically builds the Windows executable on:
- Every push to
main,develop, andfeature/**branches - Every pull request
- Every version tag (creates a release)
- Go to the Actions page
- Select a workflow run
- Scroll to "Artifacts" section
- Download
wareflow-gui-windows
To create a new release:
# Update version in pyproject.toml
vim pyproject.toml
# Commit the version bump
git add pyproject.toml
git commit -m "chore: bump version to x.y.z"
# Create and push tag
git tag vx.y.z
git push origin main --tagsGitHub Actions will automatically:
- Build the executable
- Run tests
- Create a GitHub release
- Upload the executable and checksum
If PyInstaller reports a missing module:
- Add it to
hiddenimportsinbuild/gui.spec - Rebuild with
--cleanflag
Example:
hiddenimports=[
'your_missing_module',
# ... other imports
]If the executable is larger than expected:
- Check if UPX compression is enabled:
upx=True - Add unnecessary packages to
excludesinbuild/gui.spec - Use
--exclude-modulewhen building
If the executable fails with import errors:
- Test the imports in a normal Python environment first
- Check if the module is in
hiddenimports - Verify data files are included in
datassection - Check PyInstaller hooks for problematic packages
If the GUI has rendering issues:
- Ensure customtkinter and pillow are in
hiddenimports - Check that
console=Falsefor windowed mode - Verify high DPI scaling is handled by CustomTkinter
Some antivirus software may flag PyInstaller executables:
- This is a known issue with PyInstaller
- The executable is safe (you can verify the checksum)
- In production, consider code signing the executable
Current optimization strategies in build/gui.spec:
- Exclude test frameworks (pytest, unittest, mock)
- Exclude development tools (ruff, black, mypy)
- Exclude unused standard library modules
- Enable UPX compression
Target file size: 50-80 MB
To improve startup time:
- Lazy load non-critical modules
- Optimize imports in
__main__.py - Profile the startup process
Target startup time: < 3 seconds
If you encounter build issues:
- Check the Troubleshooting section
- Search existing issues
- Create a new issue with:
- Your platform and Python version
- Full error message
- Steps to reproduce