Skip to content

Commit

Permalink
Merge branch 'main' into smarter-boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIsCoding authored Oct 4, 2024
2 parents da72eaa + c223d21 commit fabcb4b
Show file tree
Hide file tree
Showing 23 changed files with 96 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ main, 'stable/*' ]
pull_request:
branches: [ main, 'stable/*' ]
merge_group:
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
Expand All @@ -24,8 +25,8 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install -U ruff==0.4.1 black~=22.0
python-version: "3.10"
- run: pip install -U ruff==0.6.8 black~=24.8
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
strategy:
matrix:
rust: [stable]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.9, "3.10", "3.11", "3.12"]
platform: [
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
Expand All @@ -67,18 +68,16 @@ jobs:
include:
# Test minimal supported Rust version
- rust: 1.70.0
python-version: 3.8
python-version: "3.10"
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
msrv: "MSRV"
# Test future versions of Rust and Python
- rust: beta
python-version: "3.13-dev"
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
msrv: "Beta"
# Exclude python 3.8 and 3.9 on arm64 until actions/setup-python#808 is resolved
# Exclude python 3.9 on arm64 until actions/setup-python#808 is resolved
exclude:
- platform: {os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
python-version: 3.8
- platform: {os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
python-version: 3.9
steps:
Expand Down Expand Up @@ -108,7 +107,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.9, "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -178,7 +177,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install binary deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ jobs:
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_SKIP: cp36-* cp37-* *many*
CIBW_TEST_SKIP: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* *many*
CIBW_SKIP: cp36-* cp37-* cp38-* *many*
CIBW_TEST_SKIP: cp39-* cp310-* cp311-* cp312-* *many*
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
Expand Down
3 changes: 0 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
queue_rules:
- name: automerge
conditions:
- check-success=python3.8-x64 windows-latest
- check-success=python3.8-x64 ubuntu-latest
- check-success=python3.8-x64 macOS-latest
- check-success=python3.9-x64 windows-latest
- check-success=python3.9-x64 ubuntu-latest
- check-success=python3.9-x64 macOS-latest
Expand Down
30 changes: 18 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ rustworkx-core = { path = "rustworkx-core", version = "=0.16.0" }

[dependencies.pyo3]
version = "0.21.2"
features = ["abi3-py38", "extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"]
features = ["abi3-py39", "extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"]

[dependencies.sprs]
version = "^0.11"
Expand Down
1 change: 0 additions & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
decorator==4.4.2
importlib-metadata==4.13.0;python_version<'3.8'
pillow<10.0.0;python_version<'3.13'
lxml==5.1.1
10 changes: 5 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
]

lint_deps = [
"black~=22.0",
"ruff~=0.1",
"black~=24.8",
"ruff~=0.6",
"setuptools-rust",
]

stubs_deps = [
"mypy==1.8.0",
"mypy==1.11.2",
"typing-extensions",
]

def install_rustworkx(session):
session.install(*deps)
session.install(".[all]", "-c", "constraints.txt")
session.install(".", "-c", "constraints.txt")

# We define a common base such that -e test triggers a test with the current
# Python version of the interpreter and -e test_with_version launches
Expand All @@ -38,7 +38,7 @@ def base_test(session):
def test(session):
base_test(session)

@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
def test_with_version(session):
base_test(session)

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.black]
line-length = 100
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312']

[tool.ruff]
line-length = 105 # more lenient than black due to long function signatures
Expand All @@ -16,7 +16,7 @@ lint.select = [
"PYI", # flake8-pyi
"Q", # flake8-quotes
]
target-version = "py38"
target-version = "py39"
extend-exclude = ["doc"]

[tool.ruff.lint.per-file-ignores]
Expand All @@ -26,11 +26,11 @@ extend-exclude = ["doc"]
[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
skip = "pp* cp36-* cp37-* *win32 *musllinux*i686"
skip = "pp* cp36-* cp37-* cp38-* *win32 *musllinux*i686"
test-requires = "networkx"
test-command = "python -m unittest discover {project}/tests"
before-build = "pip install -U setuptools-rust"
test-skip = "cp38-*musllinux* *linux_s390x *ppc64le"
test-skip = "*linux_s390x *ppc64le"

[tool.cibuildwheel.linux]
before-all = "yum install -y wget && {package}/tools/install_rust.sh"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fixed a bug in the type hint for :func:`~rustworkx.node_link_json`.
Refer to `issue 1243 <https://github.com/Qiskit/rustworkx/issues/1243>`__ for
more information.
6 changes: 6 additions & 0 deletions releasenotes/notes/py38-eol-6443a548b6c727cc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
upgrade:
- |
The minimum supported Python version for using rustworkx has been raised to Python 3.9.
Python 3.8 has reached it's end-of-life and will no longer be supported. To use rustworkx
you will need to ensure you are using Python >=3.9.
7 changes: 4 additions & 3 deletions rustworkx/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

import numpy as np

from typing import Generic, TypeVar, Any, Callable, Iterator, overload, Sequence
from typing import Generic, TypeVar, Any, Callable, overload
from collections.abc import Iterator, Sequence

# Re-Exports of rust native functions in rustworkx.rustworkx
# To workaround limitations in mypy around re-exporting objects from the inner
Expand Down Expand Up @@ -602,8 +603,8 @@ def node_link_json(
graph: PyGraph[_S, _T] | PyDiGraph[_S, _T],
path: str | None = ...,
graph_attrs: Callable[[Any], dict[str, str]] | None = ...,
node_attrs: Callable[[_S], str] | None = ...,
edge_attrs: Callable[[_T], str] | None = ...,
node_attrs: Callable[[_S], dict[str, str]] | None = ...,
edge_attrs: Callable[[_T], dict[str, str]] | None = ...,
) -> str | None: ...
def longest_simple_path(graph: PyGraph[_S, _T] | PyDiGraph[_S, _T]) -> NodeIndices | None: ...
def isolates(graph: PyGraph[_S, _T] | PyDiGraph[_S, _T]) -> NodeIndices: ...
Expand Down
3 changes: 2 additions & 1 deletion rustworkx/generators/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from rustworkx import PyGraph
from rustworkx import PyDiGraph

from typing import Sequence, Any
from typing import Any
from collections.abc import Sequence

def cycle_graph(
num_nodes: int | None = ..., weights: Sequence[Any] | None = ..., multigraph: bool = ...
Expand Down
18 changes: 10 additions & 8 deletions rustworkx/rustworkx.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ from .visit import BFSVisitor, DFSVisitor, DijkstraVisitor
from typing import (
TypeVar,
Callable,
Iterable,
Iterator,
final,
Sequence,
Any,
Generic,
overload,
)
from collections.abc import (
Iterable,
Iterator,
Sequence,
ItemsView,
KeysView,
ValuesView,
Mapping,
overload,
Hashable,
)
from abc import ABC
Expand Down Expand Up @@ -634,16 +636,16 @@ def digraph_node_link_json(
/,
path: str | None = ...,
graph_attrs: Callable[[Any], dict[str, str]] | None = ...,
node_attrs: Callable[[_S], str] | None = ...,
edge_attrs: Callable[[_T], str] | None = ...,
node_attrs: Callable[[_S], dict[str, str]] | None = ...,
edge_attrs: Callable[[_T], dict[str, str]] | None = ...,
) -> str | None: ...
def graph_node_link_json(
graph: PyGraph[_S, _T],
/,
path: str | None = ...,
graph_attrs: Callable[[Any], dict[str, str]] | None = ...,
node_attrs: Callable[[_S], str] | None = ...,
edge_attrs: Callable[[_T], str] | None = ...,
node_attrs: Callable[[_S], dict[str, str]] | None = ...,
edge_attrs: Callable[[_T], dict[str, str]] | None = ...,
) -> str | None: ...
def parse_node_link_json(
data: str,
Expand Down
Loading

0 comments on commit fabcb4b

Please sign in to comment.