Skip to content

Bump pyo3 and rust numpy version to 0.19.0 #887

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

Merged
merged 4 commits into from
Jun 1, 2023
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
30 changes: 15 additions & 15 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 @@ -22,7 +22,7 @@ crate-type = ["cdylib"]
ahash = "0.8.0"
petgraph = "0.6.3"
fixedbitset = "0.4.2"
numpy = "0.18.0"
numpy = "0.19.0"
rand = "0.8"
rand_pcg = "0.3"
rayon = "1.6"
Expand All @@ -36,7 +36,7 @@ serde_json = "1.0"
rustworkx-core = { path = "rustworkx-core", version = "=0.13.0" }

[dependencies.pyo3]
version = "0.18.3"
version = "0.19.0"
features = ["extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"]

[dependencies.hashbrown]
Expand Down
3 changes: 2 additions & 1 deletion rustworkx/iterators.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ from typing import (
Tuple,
overload,
final,
Optional,
)
from abc import ABC
from collections.abc import Sequence
Expand Down Expand Up @@ -68,7 +69,7 @@ class RustworkxCustomVecIter(Generic[T_co], Sequence[T_co], ABC):
def __len__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: Sequence[T_co]) -> None: ...
def __array__(self, _dt: np.dtype = ...) -> np.ndarray: ...
def __array__(self, _dt: Optional[np.dtype] = ...) -> np.ndarray: ...

class RustworkxCustomHashMapIter(Generic[S, T_co], Mapping[S, T_co], ABC):
def __init__(self) -> None: ...
Expand Down
3 changes: 1 addition & 2 deletions src/digraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ use super::dag_algo::is_directed_acyclic_graph;
/// :attr:`~.PyDiGraph.attrs` attribute. This can be any Python object. If
/// it is not specified :attr:`~.PyDiGraph.attrs` will be set to ``None``.
#[pyclass(mapping, module = "rustworkx", subclass)]
#[pyo3(text_signature = "(/, check_cycle=False, multigraph=True, attrs=None)")]
#[derive(Clone)]
pub struct PyDiGraph {
pub graph: StablePyGraph<Directed>,
Expand Down Expand Up @@ -285,7 +284,7 @@ impl PyDiGraph {
#[pymethods]
impl PyDiGraph {
#[new]
#[pyo3(signature=(check_cycle=false, multigraph=true, attrs=None))]
#[pyo3(signature=(check_cycle=false, multigraph=true, attrs=None), text_signature="(/, check_cycle=False, multigraph=True, attrs=None)")]
fn new(py: Python, check_cycle: bool, multigraph: bool, attrs: Option<PyObject>) -> Self {
PyDiGraph {
graph: StablePyGraph::<Directed>::new(),
Expand Down
3 changes: 1 addition & 2 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ use petgraph::visit::{
/// :attr:`~.PyGraph.attrs` attribute. This can be any Python object. If
/// it is not specified :attr:`~.PyGraph.attrs` will be set to ``None``.
#[pyclass(mapping, module = "rustworkx", subclass)]
#[pyo3(text_signature = "(/, multigraph=True, attrs=None)")]
#[derive(Clone)]
pub struct PyGraph {
pub graph: StablePyGraph<Undirected>,
Expand Down Expand Up @@ -181,7 +180,7 @@ impl PyGraph {
#[pymethods]
impl PyGraph {
#[new]
#[pyo3(signature=(multigraph=true, attrs=None))]
#[pyo3(signature=(multigraph=true, attrs=None), text_signature = "(/, multigraph=True, attrs=None)")]
fn new(py: Python, multigraph: bool, attrs: Option<PyObject>) -> Self {
PyGraph {
graph: StablePyGraph::<Undirected>::default(),
Expand Down
3 changes: 1 addition & 2 deletions src/toposort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ enum NodeState {
/// it's set to ``False``, topological sorter will output as many nodes
/// as possible until cycles block more progress. By default is ``True``.
#[pyclass(module = "rustworkx")]
#[pyo3(text_signature = "(graph, /, check_cycle=True)")]
pub struct TopologicalSorter {
dag: Py<PyDiGraph>,
ready_nodes: Vec<NodeIndex>,
Expand All @@ -75,7 +74,7 @@ pub struct TopologicalSorter {
#[pymethods]
impl TopologicalSorter {
#[new]
#[pyo3(signature=(dag, check_cycle=true))]
#[pyo3(signature=(dag, check_cycle=true), text_signature = "(graph, /, check_cycle=True)")]
fn new(py: Python, dag: Py<PyDiGraph>, check_cycle: bool) -> PyResult<Self> {
{
let dag = &dag.borrow(py);
Expand Down