diff --git a/.github/workflows/docs_dev.yml b/.github/workflows/docs_dev.yml index a96808930..927acdcb3 100644 --- a/.github/workflows/docs_dev.yml +++ b/.github/workflows/docs_dev.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -U virtualenv setuptools wheel tox + pip install -U virtualenv setuptools wheel 'tox<4' sudo apt-get install graphviz pandoc - name: Build and publish env: diff --git a/.github/workflows/docs_release.yml b/.github/workflows/docs_release.yml index ad99f9030..8a1c3f365 100644 --- a/.github/workflows/docs_release.yml +++ b/.github/workflows/docs_release.yml @@ -18,7 +18,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -U virtualenv setuptools wheel tox + pip install -U virtualenv setuptools wheel 'tox<4' sudo apt-get install graphviz pandoc - name: Build and publish env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index daf1e1982..80b03f97e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: profile: minimal default: true - name: 'Install dependencies' - run: python -m pip install --upgrade tox + run: python -m pip install --upgrade 'tox<4' - name: 'Install binary dependencies' run: sudo apt-get install -y graphviz if: runner.os == 'Linux' @@ -118,7 +118,7 @@ jobs: profile: minimal default: true - name: 'Install dependencies' - run: python -m pip install --upgrade tox + run: python -m pip install --upgrade 'tox<4' - name: 'Install binary dependencies' run: sudo apt-get install -y graphviz if: runner.os == 'Linux' @@ -195,7 +195,7 @@ jobs: - name: Install binary deps run: sudo apt-get install -y graphviz - name: Install deps - run: pip install -U tox + run: pip install -U 'tox<4' - name: Build Docs run: tox -edocs - uses: actions/upload-artifact@v2 diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..56ce04e44 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv = "1.56.1" diff --git a/docs/source/tutorial/betweenness_centrality.rst b/docs/source/tutorial/betweenness_centrality.rst index 7375bb1c9..38114101f 100644 --- a/docs/source/tutorial/betweenness_centrality.rst +++ b/docs/source/tutorial/betweenness_centrality.rst @@ -98,7 +98,7 @@ Alternatively, you can use :func:`~rustworkx.visualization.graphviz_draw`: graph[node] = btw # Leverage matplotlib for color map - colormap = matplotlib.cm.get_cmap("magma") + colormap = matplotlib.colormaps["magma"] norm = matplotlib.colors.Normalize( vmin=min(centrality.values()), vmax=max(centrality.values()) diff --git a/src/digraph.rs b/src/digraph.rs index 1702fa714..9394577e1 100644 --- a/src/digraph.rs +++ b/src/digraph.rs @@ -2688,14 +2688,14 @@ impl PyDiGraph { } fn __getitem__(&self, idx: usize) -> PyResult<&PyObject> { - match self.graph.node_weight(NodeIndex::new(idx as usize)) { + match self.graph.node_weight(NodeIndex::new(idx)) { Some(data) => Ok(data), None => Err(PyIndexError::new_err("No node found for index")), } } fn __setitem__(&mut self, idx: usize, value: PyObject) -> PyResult<()> { - let data = match self.graph.node_weight_mut(NodeIndex::new(idx as usize)) { + let data = match self.graph.node_weight_mut(NodeIndex::new(idx)) { Some(node_data) => node_data, None => return Err(PyIndexError::new_err("No node found for index")), }; @@ -2704,7 +2704,7 @@ impl PyDiGraph { } fn __delitem__(&mut self, idx: usize) -> PyResult<()> { - match self.graph.remove_node(NodeIndex::new(idx as usize)) { + match self.graph.remove_node(NodeIndex::new(idx)) { Some(_) => Ok(()), None => Err(PyIndexError::new_err("No node found for index")), } diff --git a/src/graph.rs b/src/graph.rs index 022fd8050..dd4610698 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -1746,7 +1746,7 @@ impl PyGraph { } fn __delitem__(&mut self, idx: usize) -> PyResult<()> { - match self.graph.remove_node(NodeIndex::new(idx as usize)) { + match self.graph.remove_node(NodeIndex::new(idx)) { Some(_) => Ok(()), None => Err(PyIndexError::new_err("No node found for index")), }