Qiskit / rustworkx

A high performance Python graph library implemented in Rust.
https://www.rustworkx.org
Apache License 2.0
1.03k stars 145 forks source link

Introduce `build.rs` to reduce boilerplate #1253

Open IvanIsCoding opened 1 month ago

IvanIsCoding commented 1 month ago

Follow up of #1252

Real diff: https://github.com/IvanIsCoding/rustworkx/compare/smarter-boilerplate...IvanIsCoding:rustworkx:build-rs

This PR leverages build.rs to reduce even more the boilerplate required to add a new rustworkx function. All needed now is to add mod your_module; to the main file after adding export_rustworkx_functions! to the new module.

I don't think we can generate multiple mod a; mod b; statments in Rust due to the limitations of include!. Still, I think this is worth keeping to make contributing more straightforward with some "magic".

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 10675943168

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
build.rs 76 77 98.7%
<!-- Total: 83 84 98.81% -->
Totals Coverage Status
Change from base Build 10672676557: -0.02%
Covered Lines: 17978
Relevant Lines: 18767

💛 - Coveralls