-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate rust library from python binding #7
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 12 12
Branches 1 1
=========================================
Hits 12 12 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @MusicalNinjaDad - I've reviewed your changes and they look great!
General suggestions:
- Ensure that the separation of the Rust library and Python bindings does not introduce any regressions in functionality.
- Verify that the Python bindings are correctly integrated and accessible after the refactoring.
- Consider the impact of this separation on existing users and document any changes in usage or installation procedures.
Here's what I looked at during the review
- 🟡 General issues: 4 issues found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Docstrings: all looks good
Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨
#[pyfunction] | ||
#[pyo3(name = "fizzbuzz")] | ||
fn py_fizzbuzz(num: i32) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (code_refinement): Ensure num.fizzbuzz()
is correctly implemented for i32
Given that num.fizzbuzz()
is called on an i32
, ensure that the FizzBuzz
trait is correctly implemented for i32
, and that it behaves as expected.
@@ -0,0 +1,15 @@ | |||
use fizzbuzz::FizzBuzz; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (code_refinement): Verify FizzBuzz
trait import
Ensure that the FizzBuzz
trait is correctly imported and accessible in this context, especially considering the modularization of the Python bindings.
#[pymodule] | ||
#[pyo3(name = "fizzbuzzo3")] | ||
fn py_fizzbuzzo3(_py: Python, module: &PyModule) -> PyResult<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (code_refinement): Correct use of pymodule
attribute
Confirm that the pymodule
attribute is used correctly for integrating with Python, and that the module name fizzbuzzo3
is intended and follows naming conventions.
#[pymodule] | ||
#[pyo3(name = "fizzbuzzo3")] | ||
fn py_fizzbuzzo3(_py: Python, module: &PyModule) -> PyResult<()> { | ||
module.add_function(wrap_pyfunction!(py_fizzbuzz, module)?)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code_refinement): Error handling for module.add_function
Ensure that there is appropriate error handling for the module.add_function
call, especially considering the ?
operator is used, which will propagate errors.
No description provided.