Contributing to SPy¶
Thanks for helping improve SPy! There are many ways to contribute: trying SPy and reporting issues, improving the documentation, adding tests or examples, and working on the compiler itself.
Talk to us¶
- Discord server
- Monthly community call, on the first Wednesday of the month at 17:30 CET (Google calendar).
- Issues and pull requests on GitHub.
- The roadmap lists what we plan to work on.
Contributing code¶
The contribution workflow (fork, branch, pre-commit hooks, pull request) is described in CONTRIBUTING.md.
Development setup¶
SPy needs Python dependencies (managed by pip, uv or Pixi) and a native library, bdw-gc. The most up-to-date requirements are in the tests workflow. Run all the commands below from the root of the repository, without an active virtual environment.
To install bdw-gc yourself (the uv and pip methods):
- Debian/Ubuntu:
sudo apt install libgc-dev - macOS, with Homebrew:
brew install bdw-gc
Prerequisites: Python 3.12, pip >= 25.1 (for PEP 735 dependency groups) and bdw-gc (see above).
No prerequisite: Pixi also installs bdw-gc.
Other useful commands: pixi run ruff-format, pixi run ruff-check,
pixi run doc-serve, pixi run test-xdist.
Optional build dependencies¶
spy build compiles the generated C code to a native or WebAssembly binary.
Depending on the target:
- Native (
--target native): a system C compiler such asgccorclang(build-essentialon Debian/Ubuntu). - Emscripten (
--target emscripten): the Emscripten SDK, with thelatesttoolchain activated so thatemccis on yourPATH. - WASI (
--target wasi): uses Zig, which is installed automatically with SPy.
The interpreter and redshift work without any of these.
Running the tests¶
To understand how the compiler is organized, read The compilation pipeline.