From b583c6ad667d7557a0808bbe3b8aa22eae1224da Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Wed, 13 Sep 2023 17:07:45 +0100 Subject: [PATCH] Do explicit imports instead of `pyo3::prelude::*` --- src/builder.rs | 2 +- src/hugr.rs | 2 +- src/hugr/serialize.rs | 2 +- src/hugr/validate.rs | 2 +- src/hugr/views/sibling_subgraph.rs | 2 +- src/std_extensions/rotation.rs | 2 +- src/types.rs | 2 +- src/types/signature.rs | 2 +- src/types/type_row.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 00280dd90..c8c0cdc55 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -3,7 +3,7 @@ use thiserror::Error; #[cfg(feature = "pyo3")] -use pyo3::{create_exception, exceptions::PyException, prelude::*}; +use pyo3::{create_exception, exceptions::PyException, PyErr}; use crate::hugr::{HugrError, Node, ValidationError, Wire}; use crate::ops::handle::{BasicBlockID, CfgID, ConditionalID, DfgID, FuncID, TailLoopID}; diff --git a/src/hugr.rs b/src/hugr.rs index 5214a1b9e..46080958b 100644 --- a/src/hugr.rs +++ b/src/hugr.rs @@ -23,7 +23,7 @@ use portgraph::{Hierarchy, NodeIndex, PortMut, UnmanagedDenseMap}; use thiserror::Error; #[cfg(feature = "pyo3")] -use pyo3::{create_exception, exceptions::PyException, prelude::*}; +use pyo3::{create_exception, exceptions::PyException, pyclass}; pub use self::views::HugrView; use crate::extension::{ diff --git a/src/hugr/serialize.rs b/src/hugr/serialize.rs index 02dbaeb97..53bff8cc6 100644 --- a/src/hugr/serialize.rs +++ b/src/hugr/serialize.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; use thiserror::Error; #[cfg(feature = "pyo3")] -use pyo3::{create_exception, exceptions::PyException, prelude::*}; +use pyo3::{create_exception, exceptions::PyException, PyErr}; use crate::extension::ExtensionSet; use crate::hugr::{Hugr, NodeType}; diff --git a/src/hugr/validate.rs b/src/hugr/validate.rs index ebb9a715b..281fb80c9 100644 --- a/src/hugr/validate.rs +++ b/src/hugr/validate.rs @@ -10,7 +10,7 @@ use portgraph::{LinkView, PortView}; use thiserror::Error; #[cfg(feature = "pyo3")] -use pyo3::{create_exception, exceptions::PyException, prelude::*}; +use pyo3::{create_exception, exceptions::PyException, PyErr}; use crate::extension::SignatureError; use crate::extension::{ diff --git a/src/hugr/views/sibling_subgraph.rs b/src/hugr/views/sibling_subgraph.rs index 7bfc69997..6d9e6e67d 100644 --- a/src/hugr/views/sibling_subgraph.rs +++ b/src/hugr/views/sibling_subgraph.rs @@ -27,7 +27,7 @@ use crate::{ use super::HugrView; #[cfg(feature = "pyo3")] -use pyo3::{create_exception, exceptions::PyException, prelude::*}; +use pyo3::{create_exception, exceptions::PyException, PyErr}; /// A non-empty convex subgraph of a HUGR sibling graph. /// diff --git a/src/std_extensions/rotation.rs b/src/std_extensions/rotation.rs index 15e1da725..35b2102b9 100644 --- a/src/std_extensions/rotation.rs +++ b/src/std_extensions/rotation.rs @@ -8,7 +8,7 @@ use num_rational::Rational64; use smol_str::SmolStr; #[cfg(feature = "pyo3")] -use pyo3::prelude::*; +use pyo3::{pyclass, FromPyObject}; use crate::extension::ExtensionId; use crate::types::type_param::TypeArg; diff --git a/src/types.rs b/src/types.rs index 2d927cd55..86a44a777 100644 --- a/src/types.rs +++ b/src/types.rs @@ -26,7 +26,7 @@ use std::fmt::Debug; use self::primitive::PrimType; #[cfg(feature = "pyo3")] -use pyo3::prelude::*; +use pyo3::pyclass; /// The kinds of edges in a HUGR, excluding Hierarchy. #[derive(Clone, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize)] diff --git a/src/types/signature.rs b/src/types/signature.rs index 0e83f4037..076ba8815 100644 --- a/src/types/signature.rs +++ b/src/types/signature.rs @@ -1,7 +1,7 @@ //! Abstract and concrete Signature types. #[cfg(feature = "pyo3")] -use pyo3::prelude::*; +use pyo3::{pyclass, pymethods}; use std::ops::Index; diff --git a/src/types/type_row.rs b/src/types/type_row.rs index bedb6750c..b3b69bafe 100644 --- a/src/types/type_row.rs +++ b/src/types/type_row.rs @@ -12,7 +12,7 @@ use crate::utils::display_list; use delegate::delegate; #[cfg(feature = "pyo3")] -use pyo3::prelude::*; +use pyo3::pyclass; /// List of types, used for function signatures. #[derive(Clone, PartialEq, Eq, Debug, serde::Serialize, serde::Deserialize)]