Generate Rust GDExtension workspaces for Godot 4 by cloning a git remote and scaffolding a complete project layout.
The easiest way to run the generator is to download the .whl from a GitHub Release and invoke it with uvx — no virtualenv and no install step:
uvx --from py_rust_gdextension_cookiecutter-0.1.0-py3-none-any.whl py-rust-gdReplace the wheel filename with the version you downloaded.
Alternatively, install with pip:
pip install py-rust-gdextension-cookiecutterOr from a checkout:
pip install .py-rust-gdThe CLI clones your git remote (empty or containing only README, LICENSE, and/or .gitignore), then scaffolds:
- Core Rust library crate
- Godot 4 GDExtension (
cdylib) - Native CLI demo (and optional Bevy visualizer)
- Godot demo project
- CI workflows, git hooks, local
.gitconfigidentity (gitignored), and release packaging scripts - Documentation stubs
py-rust-gd \
--remote git@github.com:you/my-lib.git \
--project-name "My Lib" \
--no-bevy \
--output-dir .The remote may be empty or contain only:
README*(overwritten)LICENSE,LICENSE.md, orLICENSE.txt(preserved; used aslicense-fileinCargo.toml).gitignore(overwritten)
Any other files or directories cause the generator to fail with a clear error.
pip install -e ".[dev]"
pre-commit install
./scripts/setup-git-identity.shCopy .gitconfig.example to .gitconfig (gitignored) and set your name
and email. The setup script creates .gitconfig from the example if missing and includes it in
your local .git/config so it overrides a global Git identity for this repo only.
On Windows, run .\scripts\setup-git-identity.ps1 instead.
| Task | Description |
|---|---|
invoke format |
Apply Ruff formatting |
invoke lint |
Ruff format check, Ruff lint, and Mypy |
invoke test |
Run pytest |
invoke ci |
Lint and test (same as GitHub Actions) |
invoke sync-version |
Apply VERSION to __init__.py |
invoke bump |
Bump VERSION, commit, and tag vX.Y.Z |
invoke lint
invoke test
invoke ci
invoke bumpPre-commit runs invoke lint on each commit. GitHub Actions runs invoke ci on pushes and pull requests to main.
VERSION at the repository root is the single source of truth (Hatch reads it at build time).
invoke bump # interactive major/minor/patch selection
invoke bump --kind patch
invoke bump --no-commit # update files only
git push origin HEAD
git push origin v0.1.0Pushing a vX.Y.Z tag triggers .github/workflows/release.yml, which builds a platform-independent wheel (py3-none-any) and sdist, then attaches them to a GitHub Release.