Development Setup¶
All actions mentioned in this page should be performed under the repository root folder i.e. ./Blender-Launcher-V2.
Requirements¶
- Python >=3.11, <3.15
- UV (optional)
It's entirely optional to use uv as the project manager, but is strongly recommended as we use its tooling such as its lockfile and dependency resolution. Every shell snippet in this doc after the "Setting Up" step will use uv run as a prefix to indicate it needs to be run in the virtual environment.
Setting Up Development Environment¶
# Install virtualenv:
python -m pip install virtualenv
# Create the virtual environment
python -m virtualenv --clear --download .venv
Activate the virtual environment:
Install dependencies:
# Create the virtual environment & install dependencies:
pdm install
# Install with all development groups:
pdm install -G:all
Activate the virtual environment:
Or run commands directly with PDM:
Running Blender Launcher1¶
# Generate the cached resource files:
# This creates necessary files like `resources_rc.py` and `global.qss`.
# This only needs to run once, unless you're updating widget styles.
uv run build_style.py
# Run the application
uv run source/main.py
Building Blender Launcher Executable2¶
Build the executable¶
Run the build script:
These scripts will create a standalone executable using PyInstaller. Once finished, the executable can be found under the Blender-Launcher-V2/dist/release folder.
Documentation¶
Previewing the Documentation¶
or use the providedscripts/serve_docs.* scripts.
Then open the given link (likely http://127.0.0.1:8000/) in a web browser.
Edit Documentation Files¶
Make the desired modifications in the .md files under the docs/docs directory. The changes should be reflected in the main preview mentioned above.
Common Development Tasks¶
Running Tests¶
Code Formatting and Linting¶
Check code with Ruff:
Format code with Ruff:
-
As of (c90f33d ~v2.4.0), cached Blender-Launcher-V2 files (such as resources_rc.py and global.qss) are no longer included in the source due to them artificially inflating git diffs.
In order to generate them, run the
build_style.pyscript located in the root project directory. Running Blender Launcher without these being built will result in an error. ↩ -
Cross-platform compilation
Executables made in PyInstaller must be built inside the target platform. You cannot build for a different platform other than your own.