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

feat!: implement Python wrappers for the full Rust API #230

Merged
merged 22 commits into from
Jan 24, 2023

Conversation

Shadow53
Copy link
Contributor

@Shadow53 Shadow53 commented Jan 9, 2023

Resolves #208.

This does not include tests for the new Python stuff, but no clippy lints are triggered. There are changes made to the Rust crate in order to make this work, but everything should just work as before.

crates/lib/src/api.rs Show resolved Hide resolved
crates/lib/src/api.rs Show resolved Hide resolved
crates/lib/src/configuration/mod.rs Show resolved Hide resolved
crates/lib/src/executable.rs Show resolved Hide resolved
crates/lib/src/executable.rs Show resolved Hide resolved
crates/lib/src/execution_data.rs Show resolved Hide resolved
crates/lib/src/lib.rs Show resolved Hide resolved
crates/lib/src/qvm/execution.rs Show resolved Hide resolved
crates/python/src/api.rs Show resolved Hide resolved
crates/python/src/executable.rs Show resolved Hide resolved
Copy link
Contributor

@jselig-rigetti jselig-rigetti left a comment

Choose a reason for hiding this comment

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

Overall looks great!

  • We should merge the rigetti-pyo3:support-fieldless-enums-data-structs branch first, right?
  • Do we still need to hand-write the .pyi files?

crates/lib/src/api.rs Outdated Show resolved Hide resolved
crates/python/Cargo.toml Outdated Show resolved Hide resolved
crates/python/src/register_data.rs Show resolved Hide resolved
crates/python/src/api.rs Show resolved Hide resolved
crates/python/src/qpu/client.rs Outdated Show resolved Hide resolved
crates/python/src/executable.rs Show resolved Hide resolved
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.

This is a big PR, so I'll take another pass later, but looking good so far. I would make sure we use conventional commits to properly call out breaking changes. I called out one on an enum, but it looks like there are others related to the shift to Cow

crates/lib/src/api.rs Outdated Show resolved Hide resolved
@Shadow53
Copy link
Contributor Author

Shadow53 commented Jan 10, 2023

From @jselig-rigetti:

We should merge the rigetti-pyo3:support-fieldless-enums-data-structs branch first, right?

Correct.

Do we still need to hand-write the .pyi files?

I think so. This issue is still open. The #[args()] attribute sets __text_signature__, which is helpful, but not the same as type stubs.

From @MarquessV:

I would make sure we use conventional commits to properly call out breaking changes.

I've revised commit messages to include the ! to indicate breaking changes.

Copy link
Contributor

@kalzoo kalzoo left a comment

Choose a reason for hiding this comment

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

Aside from the version bump following upstream PR, this meets the bar to merge. Noting, of course, that we're about to break just about every function in the Python bindings once @MarquessV 's Program changes land.

crates/lib/src/api.rs Outdated Show resolved Hide resolved
crates/python/src/lib.rs Outdated Show resolved Hide resolved
crates/python/src/api.rs Show resolved Hide resolved
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.

Looks good!

@Shadow53 Shadow53 changed the title feat: implement Python wrappers for the full Rust API feat!: implement Python wrappers for the full Rust API Jan 24, 2023
@Shadow53 Shadow53 merged commit bb063c7 into main Jan 24, 2023
@Shadow53 Shadow53 deleted the 208-return-pyo3-types branch January 24, 2023 19:29
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.

The Python bindings should return opaque pointers instead of dictionaries
4 participants