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

Add Python crate and improve error handling #23

Merged
merged 10 commits into from
Sep 6, 2023
Merged

Add Python crate and improve error handling #23

merged 10 commits into from
Sep 6, 2023

Conversation

notmgsk
Copy link
Contributor

@notmgsk notmgsk commented Aug 2, 2023

This MR:

Closes #20
Closes #21
Closes #22

notmgsk added 3 commits July 19, 2023 19:47
and rework some other stuff to be more rusty
* improves error support
* improves libquilc.core loading
* fixes libquilc.so missing symbols
* adds lib tests
* renames python module to libquil_py
lib/build.rs Outdated Show resolved Hide resolved
lib/src/lib.rs Show resolved Hide resolved
@notmgsk notmgsk marked this pull request as ready for review August 3, 2023 18:11
@notmgsk notmgsk requested review from MarquessV and Shadow53 August 3, 2023 18:11
Copy link
Contributor

@MarquessV MarquessV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments, might be good to have some type stubs validated via stubtest, but would be fine with adding those later too, if we think the API might drift from this point.

)
.unwrap();
}
init_submodule("libquil_py", py, m)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module name should be libquil right?

python/src/lib.rs Outdated Show resolved Hide resolved
Originally had it in the Python bindings, but if Python bindings
(e.g. qcs-sdk-rust) depend on this library, they won't necessarily
import the Python code and thus won't hit the path that loads
libquilc.so.

By having it in the library's init, we can ensure that libquilc.so
is always loaded.
@notmgsk notmgsk merged commit d7190a1 into main Sep 6, 2023
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.

Improve error messages Python bindings crash during libquilc's "init" call Python bindings
3 participants