DEVELOPMENT
goals
- Provide a really nice ergonomic API to work with (this is the highest priority)
- Get naming right (this is a hard one!)
- Be fast
development-setup
- clone repo
- install
just(cargo install just) - create a virtual env (using ye olde
venvoruvor dare I sayconda) – I am still working out the kinks of usinguvwith maturin - install the dev-requirements (
pip install -r requirements.dev.txt) - run
just devto build and test the library - run
just fmtto format the python and rust code
style guide
- Naming conventions:
- For python classes/structs/types prefer
AsyncXYZoverXYZAsync - use
snake_casefor functions and variables - use
CamelCasefor types and traits - use
SCREAMING_SNAKE_CASEfor constants and static-class-attributes
- For python classes/structs/types prefer
- NO UNWRAPPING – use
expectoverunwrap - NO PANICS – don’t panic!
- NO
blazingly-fast–ryis fast and does not need an adverb - USE CLIPPY
just clippyorjust ci - USE RUSTFMT AND RUFF
just fmt - library style guide:
- python objects/structs/classes defined in the library should be named either
Py<CLASSNAME>orRy<CLASSNAME>and the prefix should be consistent throughout the library (egryo3-jiffusesRyas the internal prefix to not conflict with thePy<CLASSNAME>structs provided bypyo3) - For wrapper libraries, attempt to mirror the structure of the original library as much as possible
- wrapper library names should be of the form
ryo3-<LIB_NAME>where<LIB_NAME>is the name of the wrapped library - library directories should be
kebab-caseand should beryo3-<LIB_NAME>
- python objects/structs/classes defined in the library should be named either
Creating a new library/wrapper-thing
- copy the template library
ryo3-quick-mathslibrary to your new library name - refer to the above style guide for naming conventions
tools
python
- we use
maturinfor building the python wheels - we support
python-3.11+ - we use
pytestfor testing as well as the following plugins:anyio(which I am increasingly thinking is actually a bit of a turd)hypothesispytest-benchmarkpytest-cov
just
cargo install just
- we use
justfor task running - to see all tasks run
justorjust --list(our default task echos the list of tasks)
tasks as of 2025-09-26:
Available recipes:
repl # run ry.dev python repl
repl-uv # run ry.dev python repl (if using uv)
dev # dev run build + tests
dev-uv # dev run build + tests (with uv)
sync # uv sync
develop # maturin develop
develop-uv # maturin develop (with uv)
mat # maturin develop (shorthand)
cargo-test # cargo test
build # build
build-release # build release
dev-rel # maturin develop release
doctest # run pytest
pytest # run pytest
pytest-uv # run pytest
pytestv # run pytest (printing captured output)
test # run all test
test-release # test ry package
bench # benchmark ry python package
ci # ci rust checks
cargo-fmt # cargo format
cargo-fmtc # cargo format check
sort-all-check # ruff check sorting of '__all__'
sort-all # ruff sort '__all__'
ruff-fmt # ruff format
ruff-fmtc # ruff format check
fmtpy # python format
fmtcpy # python format check
justfilefmt # justfile format
justfilefmtc # justfile format check
mdfmt # format markdown
pyprojectfmt # pyproject-fmt
fmt # format
fmtc # format check
ruff # run ruff linter
ruffix # run ruff + fix
clippy # run clippy
clippy-features # run clippy with feature-powerset via cargo-hack
lint # lint python and rust
mypy # run mypy type checker
pyright # run pyright
pip-compile # pip compile requirements
gen # generate code tasks
cargo-doc # generate cargo docs for all crates (in workspace)