Skip to content
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

Merged
merged 2 commits into from
Mar 19, 2024
Merged

Conversation

MusicalNinjaDad
Copy link
Owner

No description provided.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fca1ae8) to head (b705cb2).

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.
📢 Have feedback on the report? Share it here.

@MusicalNinjaDad MusicalNinjaDad merged commit a262d0e into main Mar 19, 2024
16 checks passed
@MusicalNinjaDad MusicalNinjaDad deleted the packaging branch March 19, 2024 18:21
Copy link

@sourcery-ai sourcery-ai bot left a 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? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Comment on lines +4 to +6
#[pyfunction]
#[pyo3(name = "fizzbuzz")]
fn py_fizzbuzz(num: i32) -> String {
Copy link

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;
Copy link

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.

Comment on lines +10 to +12
#[pymodule]
#[pyo3(name = "fizzbuzzo3")]
fn py_fizzbuzzo3(_py: Python, module: &PyModule) -> PyResult<()> {
Copy link

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)?)?;
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant