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: update to pyo3 23 (allow free-threaded python) #102

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ path = "tests/lib.rs"
[workspace.dependencies]
derive_more = "1.0.0"
itertools = "0.13.0"
pyo3 = "0.22.2"
pythonize = "0.22.0"
pyo3 = "0.23.2"
pythonize = "0.23.0"
rstest = "0.23.0"
serde = "1.0"
serde_json = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/pytket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl SerialCircuit {
/// Convert a `SerialCircuit` to a `pytket.Circuit`.
pub fn to_tket1<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
let dict = pythonize(py, self).unwrap();
let circ_module = PyModule::import_bound(py, "pytket.circuit")?;
let circ_module = PyModule::import(py, "pytket.circuit")?;

circ_module
.getattr("Circuit")?
Expand Down
4 changes: 2 additions & 2 deletions tests/missing_optypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn missing_optypes() -> PyResult<()> {

pyo3::prepare_freethreaded_python();
Python::with_gil(|py| {
let Ok(pytket) = PyModule::import_bound(py, "pytket") else {
let Ok(pytket) = PyModule::import(py, "pytket") else {
panic!("Failed to import `pytket`. Make sure the python library is installed.");
};
let py_enum = pytket.getattr("OpType")?;
Expand Down Expand Up @@ -67,7 +67,7 @@ fn missing_classical_optypes() -> PyResult<()> {

pyo3::prepare_freethreaded_python();
Python::with_gil(|py| {
let Ok(pytket) = PyModule::import_bound(py, "pytket") else {
let Ok(pytket) = PyModule::import(py, "pytket") else {
panic!("Failed to import `pytket`. Make sure the python library is installed.");
};
let py_enum = pytket.getattr("circuit")?.getattr("ClOp")?;
Expand Down
Loading