codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

[codecov-rs/rust] Set up maturin + write first Python binding: Rust+SQLite constructor #2315

Open matt-codecov opened 3 weeks ago

matt-codecov commented 3 weeks ago

Set up maturin and write our first Python bindings:

For purposes of this task, the SqliteReport binding just needs to be able to be passed around in Python and doesn't need to expose any functionality.

codecov-rs should first-and-foremost be a standalone Rust library and we don't want our near-term Python integration needs to shape its design. As we write Python bindings we should consider whether we want to pepper PyO3 attributes throughout the code or introduce some dedicated types to serve as a Python bridge.

Swatinem commented 2 weeks ago

As we write Python bindings we should consider whether we want to pepper PyO3 attributes throughout the code or introduce some dedicated types to serve as a Python bridge.

I might be biased towards the solution in https://github.com/getsentry/ophio?tab=readme-ov-file#repo-structure. The repo there is split into a pure-rust crate, a pyo3 bindings crate, plus a python project that defines pyi typings and re-exports types into a module/package hierarchy.