Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ff76ef8
Remove retworkx and Python 3.9 support
IvanIsCoding Sep 21, 2025
729755d
Add release notes for Python 3.9 EoL
IvanIsCoding Sep 21, 2025
2fbb343
Add retworkx removal release note
IvanIsCoding Sep 21, 2025
7df0fe9
Merge remote-tracking branch 'upstream/main' into remove-39-retworkx
IvanIsCoding Sep 21, 2025
3084019
Drop 3.9 support in pyproject.toml and uv
IvanIsCoding Sep 21, 2025
1dd621c
Bump other 39 -> 310 related things
IvanIsCoding Sep 21, 2025
f52487b
Merge remote-tracking branch 'upstream/main' into remove-39-retworkx
IvanIsCoding Oct 24, 2025
e5ca8f4
use 3.14 not 3.14-dev
IvanIsCoding Oct 24, 2025
78ce745
Move note to upgrade
IvanIsCoding Oct 24, 2025
711cfdc
Upgrade packages to support 3.14
IvanIsCoding Nov 2, 2025
03afe1b
Allowlist missing __all__ for mypy
IvanIsCoding Nov 2, 2025
a222850
Add 3.14 to workflow
IvanIsCoding Nov 2, 2025
7c87aa7
Add release note
IvanIsCoding Nov 2, 2025
fe13da0
Use Python 3.12 for release
IvanIsCoding Nov 2, 2025
03e6329
Skip Python 3.9
IvanIsCoding Nov 2, 2025
1ebe14a
Skip 3.14 free-threaded build
IvanIsCoding Nov 2, 2025
5b76c1f
Bump nox as well
IvanIsCoding Nov 3, 2025
e33e188
Merge branch 'main' into remove-39-retworkx
IvanIsCoding Nov 4, 2025
b875800
Merge branch 'main' into upgrade-314
IvanIsCoding Nov 4, 2025
795ad00
Use ruff
IvanIsCoding Nov 30, 2025
9b124f5
Use ruff in CI
IvanIsCoding Nov 30, 2025
6ea0993
Merge branch 'main' into ruff-format
IvanIsCoding Nov 30, 2025
435fb73
Merge branch 'main' into ruff-format
IvanIsCoding Dec 5, 2025
a2c5ea0
Merge branch 'main' into upgrade-314
IvanIsCoding Dec 5, 2025
7bd603c
Merge branch 'main' into remove-39-retworkx
IvanIsCoding Dec 5, 2025
b9d1a15
Use macos-15-intel for tests
IvanIsCoding Dec 13, 2025
cfa1ae6
Update wheels.yml to use macos-15-intel
IvanIsCoding Dec 13, 2025
418b6fc
Merge branch 'remove-39-retworkx' into upgrade-314
IvanIsCoding Dec 13, 2025
9e0b0b3
Merge branch 'upgrade-314' into ruff-format
IvanIsCoding Dec 13, 2025
b5600b9
Merge branch 'main' into ruff-format
IvanIsCoding Dec 13, 2025
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
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.10'
python-version: '3.12'
- name: Install dependencies
run: |
pip install -U --group testinfra
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.10'
python-version: '3.12'
- name: Install dependencies
run: |
pip install -U --group testinfra
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- run: |
pip install -U --group lint
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -37,10 +37,10 @@ jobs:
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Black Codestyle Format
run: black --check --diff rustworkx tests retworkx
- name: Ruff Codestyle Format
run: ruff format --check --diff rustworkx tests
- name: Python Lint
run: ruff check rustworkx setup.py tests retworkx
run: ruff check rustworkx setup.py tests
- name: Check stray release notes
run: python tools/find_stray_release_notes.py
- name: rustworkx-core Rust Tests
Expand All @@ -61,7 +61,7 @@ jobs:
strategy:
matrix:
rust: [stable]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
platform: [
{ os: "macos-15-intel", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
Expand All @@ -70,20 +70,16 @@ jobs:
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
]
include:
# Test ARM + minimal supported Rust version
# Test minimal supported Rust version
- rust: 1.85.1
python-version: "3.10"
python-version: "3.12"
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
msrv: "MSRV"
# Test ARM + future versions of Rust and Python
# Test future versions of Rust and Python
- rust: beta
python-version: "3.13" # upgrade to 3.14-dev when the release candidate is available
python-version: "3.14" # upgrade to 3.15-dev when the release candidate is available
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
msrv: "Beta"
# 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.9
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -112,7 +108,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -137,7 +133,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand Down Expand Up @@ -185,7 +181,7 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install binary deps
Expand Down
41 changes: 9 additions & 32 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'
- name: Install deps
run: pip install -U setuptools-rust build
- name: Build sdist
Expand All @@ -47,13 +47,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14, ubuntu-24.04-arm]
os: [ubuntu-latest, windows-latest, macos-15-intel, macos-14, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'
- uses: dtolnay/rust-toolchain@stable
- name: Install cibuildwheel
run: |
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -110,7 +110,7 @@ jobs:
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp36-* cp37-* pp* *win32 *musl*
CIBW_SKIP: pp* cp314t* *win32 *musl*
CIBW_ARCHS_LINUX: ppc64le
- uses: actions/upload-artifact@v4
with:
Expand All @@ -135,7 +135,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -148,7 +148,7 @@ jobs:
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp36-* cp37-* pp* *win32 *musl*
CIBW_SKIP: pp* cp314t* *win32 *musl*
CIBW_ARCHS_LINUX: s390x
- uses: actions/upload-artifact@v4
with:
Expand All @@ -167,7 +167,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: '3.12'
architecture: 'x86'
- uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -181,31 +181,8 @@ jobs:
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_SKIP: cp36-* cp37-* pp* *amd64 *musl*
CIBW_SKIP: pp* cp314t* *amd64 *musl*
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: shared-wheel-builds-win32
retworkx-compat-build:
name: Build retworkx
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
needs: ["upload_shared_wheels"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Install deps
run: pip install -U setuptools-rust wheel build
- name: Build sdist
run: pushd retworkx && python setup.py bdist_wheel && popd
- uses: actions/upload-artifact@v4
with:
path: ./retworkx/dist/*
name: sdist-retworkx
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ cargo clippy --workspace --all-targets -- -D warnings

Python is used primarily for tests and some small pieces of packaging
and namespace configuration code in the actual library.
[black](https://github.com/psf/black) and [flake8](https://flake8.pycqa.org/en/latest/) are used to enforce consistent
[ruff](https://github.com/astral-sh/ruff) is used to enforce consistent
style in the python code in the repository. You can run them via Nox using:

```bash
Expand All @@ -295,7 +295,7 @@ nox -e lint
This will also run `cargo fmt` in check mode to ensure that you ran `cargo fmt`
and will fail if the Rust code doesn't conform to the style rules.

If black returns a code formatting error you can run `nox -e black` to automatically
If ruff returns a code formatting error you can run `nox -e format` to automatically
update the code formatting to conform to the style.

### Building documentation
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ nalgebra-sparse = { version = "=0.10", features = ["io"] }

[dependencies.pyo3]
version = "0.26"
features = ["abi3-py39", "extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap", "py-clone"]
features = ["abi3-py310", "extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap", "py-clone"]

[dependencies.sprs]
version = "^0.11"
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ operations on the graph. For example:

.. jupyter-execute::

lolipop_graph = rx.generators.lollipop_graph(4, 3)
lollipop_graph = rx.generators.lollipop_graph(4, 3)
mesh_graph = rx.generators.mesh_graph(4)
combined_graph = rx.cartesian_product(lolipop_graph, mesh_graph)[0]
combined_graph = rx.cartesian_product(lollipop_graph, mesh_graph)[0]
mpl_draw(combined_graph)

Additionally there are alternate constructors such as
Expand Down
17 changes: 11 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ def base_test(session):
def test(session):
base_test(session)

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

@nox.session(python=["3"])
def lint(session):
black(session)
format(session)
typos(session)
session.install(*lint_deps)
session.run("ruff", "check", "rustworkx", "retworkx", "setup.py")
session.run("ruff", "check", "rustworkx", "setup.py")
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
session.run("python", "tools/find_stray_release_notes.py")

Expand Down Expand Up @@ -71,10 +71,15 @@ def docs_clean(session):
session.chdir("docs")
session.run("rm", "-rf", "build", "source/apiref", external=True)

@nox.session(python=["3"])
def format(session):
session.install(*[d for d in lint_deps if "ruff" in d])
session.run("ruff", "format", "rustworkx", "tests", *session.posargs)

@nox.session(python=["3"])
def black(session):
session.install(*[d for d in lint_deps if "black" in d])
session.run("black", "rustworkx", "tests", "retworkx", *session.posargs)
# Legacy black formatting session is aliased
format(session)

@nox.session(python=["3"])
def typos(session):
Expand All @@ -87,4 +92,4 @@ def stubs(session):
install_rustworkx(session)
session.install(*stubs_deps)
session.chdir("tests")
session.run("python", "-m", "mypy.stubtest", "--concise", "rustworkx")
session.run("python", "-m", "mypy.stubtest", "--concise", "rustworkx", "--allowlist", "stubs_allowlist.txt")
38 changes: 21 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rustworkx"
version = "0.17.1"
description = "A High-Performance Graph Library for Python"
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"numpy>=1.16.0,<3"
]
Expand All @@ -13,11 +13,11 @@ classifiers=[
"Intended Audience :: Science/Research",
"Programming Language :: Rust",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
Expand All @@ -29,7 +29,7 @@ packages = ["rustworkx", "rustworkx.visualization"]
include-package-data = true

[tool.distutils.bdist_wheel]
py-limited-api = "cp39"
py-limited-api = "cp310"

[[tool.setuptools-rust.ext-modules]]
target = "rustworkx.rustworkx"
Expand Down Expand Up @@ -66,8 +66,8 @@ build-backend = "setuptools.build_meta"

[dependency-groups]
testinfra = [
"nox==2025.5.1",
"uv==0.7.8",
"nox==2025.10.16",
"uv==0.9.7",
]
test = [
"setuptools-rust",
Expand All @@ -76,13 +76,12 @@ test = [
"stestr>=4.1",
]
lint = [
"black~=24.8",
"ruff==0.11.9",
"ruff==0.14.3",
"setuptools-rust",
"typos~=1.28",
"typos~=1.39",
]
stubs = [
"mypy==1.11.2",
"mypy==1.17.1",
"typing-extensions>=4.4",
]
docs = [
Expand All @@ -100,15 +99,11 @@ docs = [
"lxml_html_clean",
]
releaseinfra = [
"cibuildwheel==2.23.2",
"cibuildwheel==3.2.1; python_version >= '3.11'",
]

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

[tool.ruff]
line-length = 105 # more lenient than black due to long function signatures
line-length = 100
src = ["rustworkx", "setup.py", "tests"]
lint.select = [
"E", # pycodestyle
Expand All @@ -117,22 +112,31 @@ lint.select = [
"PYI", # flake8-pyi
"Q", # flake8-quotes
]
target-version = "py39"
target-version = "py310"
extend-exclude = ["doc"]

[tool.ruff.lint.per-file-ignores]
"rustworkx/__init__.py" = ["F405", "F403"]
"*.pyi" = ["F403", "F405", "PYI001", "PYI002"]

[tool.ruff.lint.pycodestyle]
max-line-length = 105 # lint has a larger limit than the formatter because of long signatures

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true

[tool.typos.default]
extend-ignore-words-re = [
"[Ss]toer",
"[Bb]rin",
]

[tool.cibuildwheel]
manylinux-x86_64-image = "manylinux2014"
manylinux-i686-image = "manylinux2014"
skip = "pp* cp36-* cp37-* cp38-* *win32 *musllinux*i686"
skip = "pp* cp314t* *win32 *musllinux*i686"
test-requires = "networkx"
test-command = "python -m unittest discover {project}/tests"
before-build = "pip install -U setuptools-rust"
Expand Down
Loading