Dev setup¶
Requirements¶
Python
3.9,3.10, or3.11Git
PowerShell (Windows workflow is the most maintained path)
For native backend development on Windows:
vcpkgplus SDL2 libraries available to CMake
One-command setup (Windows)¶
./scripts/dev_install.ps1
This script:
creates/uses
.venvinstalls editable package dependencies under
packages/*installs dev tools (
pytest,black,isort,mypy,pylint,pre-commit)installs docs tooling (Sphinx + extensions)
Native backend setup¶
The pygame backend is pure Python. The native backend is not.
mini_arcade_native_backend combines:
Python source from
packages/mini-arcade-native-backend/srca compiled
_nativeextension from the active virtual environment
That means editable development has one extra failure mode: Python code can be newer than the compiled extension. If that happens, imports may succeed while runtime symbols are missing or out of date.
Recommended Windows flow with vcpkg¶
Install
vcpkg.Install native dependencies for your triplet, for example:
vcpkg install sdl2:x64-windows sdl2-ttf:x64-windows sdl2-mixer:x64-windows
Run setup with the toolchain environment enabled:
./scripts/dev_install.ps1 -SetVcpkgEnv -VcpkgRoot C:\src\vcpkg
Rebuild only the native backend¶
If you update native backend Python or C++ code and want to resync the active environment:
python -m pip install -e .\packages\mini-arcade-native-backend
Verify installation¶
python -m mini_arcade.main --help
pytest
Native backend verification:
python .\manage.py run --example config/backend_swap --pass-through --backend native
python .\manage.py run --game space-invaders
Common checks¶
./scripts/check-black.ps1
./scripts/check-isort.ps1
./scripts/check-pylint.ps1
Notes¶
Prefer editable installs for package development.
Run commands from repo root unless noted otherwise.
Keep tooling consistent across packages: format, lint, type-check, test.
Explicit
backend.provider: nativeconfiguration is strict. Games should fail loudly if native setup is broken rather than silently switching backends.The root
manage.pyis the standard local entrypoint because it wires workspacepackages/*/srcpaths ahead of installed site-packages.