Development¶
Tests¶
The tests run with pytest and use Blender as a Python module, so they need a
bpy-compatible Python and OpenGL for Workbench (a GPU, or Mesa on Linux):
uv venv --python 3.13 .venv
uv pip install -e ".[module,test]"
.venv/bin/python -m pytest
Without bpy, only the tests that don't need Blender run, and the rest are skipped.
GitHub Actions (.github/workflows/tests.yml) runs the suite on every push to main or
dev and every pull request: with bpy 5.x (Python 3.13), and bpy 4.5 and 4.2, the
oldest supported version (Python 3.11), on Linux with Mesa software rendering, and
without Blender on Python 3.11 and 3.12.
Examples¶
example.py, the Full example of the Quick start page and the README example must run.
scripts/check_examples.py builds a scene for each (scripts/example_scenes.py, as their
descriptions say), runs them with a few datapoints in every Blender app and every Python
with bpy given, and prints OK or FAIL with the folder of the logs:
python scripts/check_examples.py --out /tmp/examples \
--blender "/Applications/Blender.app/Contents/MacOS/Blender" \
--python .venv/bin/python --python .venv42/bin/python
Run it before a release.
Lint¶
Ruff checks the code (its settings are in
pyproject.toml, it is in the dev extra), and CI runs it too:
.venv/bin/ruff check . # --fix sorts the imports
Branches¶
main always holds the latest release, because the installation instructions clone it
or pip install it from GitHub, and the docs site is deployed from it. Development
happens on dev (or feature branches merged into dev); main only moves on a
release.
Changelog¶
CHANGELOG.md (shown on the Changelog page) follows
Keep a Changelog. Every user-facing change adds
a line under ## [Unreleased], in Added, Changed, Deprecated, Removed or
Fixed, in the same commit as the change. Entries are written for users: what they
can do now or what behaves differently, not how it was implemented.
Releasing¶
Releases are made by .github/workflows/release.yml:
- Run the examples (see Examples).
- On
dev, set the newversioninpyproject.tomland inbl_infoinblendmentation/__init__.py(the add-on's version), and inCHANGELOG.mdrename## [Unreleased]to## [<version>] - <YYYY-MM-DD>, add an empty## [Unreleased]above it, and update the compare links at the bottom. Commit them. The tests fail when the version inpyproject.tomlhas no changelog section with entries, or differs frombl_info. - Merge
devintomain:git checkout main && git merge --ff-only dev && git push. - Tag that commit with the same version and push the tag:
git tag v0.7.3 && git push origin v0.7.3.
The workflow runs the tests, checks that the tag matches the version, builds the wheel,
the sdist and the Blender add-on zip (blendmentation-addon-<version>.zip, the
blendmentation folder), and creates a GitHub release with the three files attached. Its notes are the
version's section of CHANGELOG.md (.github/scripts/release_notes.py); without one,
the release fails before anything is published. It is not
published to PyPI yet; a specific release can be installed from its wheel, e.g.
pip install https://github.com/mmaciejak/Blendmentation/releases/download/v0.7.3/blendmentation-0.7.3-py3-none-any.whl.
Known issues¶
- EEVEE AOV bug (Blender 5.2): a Value AOV listed before a Color AOV in the view layer renders as all zeros. Put Color AOVs first in the list. Cycles is not affected.
- Blender 6: Blender 5.2 warns that
Material.use_nodesand light node trees will be removed in Blender 6.