How it is built and tested¶
rustmy is a Rust workspace with a pure-Rust protocol core (rustmy-proto:
packets, handshake, authentication, TLS, row decoding; no unsafe) and thin
PyO3 bindings that build Python objects straight from the
wire. The asyncio API runs the same protocol code, written once as async
functions over a transport.
On every pull request¶
- The PEP 249 compliance suite (
dbapi20.py), SQLAlchemy's dialect suite (blocking and asyncio) and part of Django's test suite (all of it weekly), the latter compared test by test with mysqlclient. - Property-based tests with hypothesis
against real servers: arbitrary text and bytes must round-trip byte for
byte, and generated injection attempts must stay values, with and without
NO_BACKSLASH_ESCAPES. - Every character set of every supported server, character by character.
- Differential tests against PyMySQL.
- Integration tests on all nine supported server versions, uncompressed and compressed, and every supported Python against MySQL and MariaDB.
- Performance tracking with CodSpeed, and coverage of the Python and Rust code (the bindings included, measured through the Python tests) on Codecov.
cargo clippywith pedantic lints and no panics, andcargo denyfor licenses and advisories.
asyncio against the blocking API¶
Hypothesis stores and reads the same generated values through rustmy.aio
and the blocking connection, with every kind of cursor, and requires the same
rows, descriptions and counts.
Fuzzing¶
The protocol code is fuzzed with cargo-fuzz (packets, compression, the handshake, result sets, row values, the SQL scanner and whole sessions), and a differential fuzzer runs each generated session through the current code and the 1.3.2 release, failing on any difference in results or errors.
Before a release¶
scripts/leak_check.py runs every path through the driver (connections, each
cursor, prepared statements, errors, executemany, compression, LOAD DATA
LOCAL INFILE…), blocking and asyncio, pools included, thousands of times and
checks that memory stops growing.
Releases are built and published by GitHub Actions, with every action pinned to a commit. Each wheel and the sdist carry a signed build provenance attestation, checked before publishing, and PyPI's own:
Built with¶
- PyO3 and maturin: Rust bindings and packaging for Python.
- rustls, ring and rustls-platform-verifier: TLS without OpenSSL.
- RustCrypto (
rsa,sha1,sha2,pbkdf2) and ed25519-dalek: the authentication methods. - SQLAlchemy: the dialects build on its MySQL dialect.
- uv, Ruff, mypy, pytest, hypothesis, cargo-deny and cargo-fuzz: development and testing.
- Zensical and mkdocstrings: this site.
- Stuart Bishop's DB-API 2.0 compliance suite (public domain).
The licenses of the Rust crates compiled into each wheel ship with it in
THIRD-PARTY-LICENSES.