Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
cbb9b7b
Draft of lockfiles
IvanIsCoding Nov 3, 2025
5b76c1f
Bump nox as well
IvanIsCoding Nov 3, 2025
93fc80e
Merge branch 'upgrade-314' into more-lockfiles
IvanIsCoding Nov 3, 2025
7aa701a
Add lockfiles per depenency-group
IvanIsCoding Nov 3, 2025
ab75350
Delete constraints.txt
IvanIsCoding Nov 3, 2025
0218e4f
Minor adjustments
IvanIsCoding Nov 3, 2025
53bb300
No constraints.txt
IvanIsCoding Nov 4, 2025
698e84d
Merge remote-tracking branch 'upstream/main' into more-lockfiles
IvanIsCoding Nov 4, 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
26 changes: 11 additions & 15 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 @@ -38,9 +38,9 @@ jobs:
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Black Codestyle Format
run: black --check --diff rustworkx tests retworkx
run: black --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-13", 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
39 changes: 8 additions & 31 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 @@ -53,7 +53,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: 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
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
2 changes: 0 additions & 2 deletions constraints.txt

This file was deleted.

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
55 changes: 50 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@

nox.options.reuse_existing_virtualenvs = True
nox.options.stop_on_first_error = True
nox.options.download_python = 'never'

pyproject = nox.project.load_toml("pyproject.toml")

deps = nox.project.dependency_groups(pyproject, "test")
lint_deps = nox.project.dependency_groups(pyproject, "lint")
stubs_deps = nox.project.dependency_groups(pyproject, "stubs")

requires_python = pyproject["project"]["requires-python"]
supported_python_versions = nox.project.python_versions(pyproject)
min_python_version = min(supported_python_versions)

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

# 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 @@ -25,7 +30,7 @@ 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)

Expand All @@ -34,7 +39,7 @@ def lint(session):
black(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 @@ -74,7 +79,7 @@ def docs_clean(session):
@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)
session.run("black", "rustworkx", "tests", *session.posargs)

@nox.session(python=["3"])
def typos(session):
Expand All @@ -87,4 +92,44 @@ 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")

@nox.session(
python=["3"],
venv_backend="uv",
reuse_venv=False,
default=False,
)
def compile_locks(session):
from pathlib import Path
print("Supported Python versions:", supported_python_versions)

dependency_groups = pyproject.get("dependency-groups")

# Ensure requirements directory exists
requirements_dir = Path("requirements")
requirements_dir.mkdir(exist_ok=True)

# Process each dependency group
for group_name in dependency_groups.keys():
session.log(f"Compiling dependency group: {group_name}")

group_dir = requirements_dir / group_name
group_dir.mkdir(exist_ok=True)
output_file = group_dir / "pylock.toml"

# Compile lockfile
uv_python = f"python{min_python_version}"
session.run(
"uv",
"pip",
"compile",
"--python",
uv_python,
"--group",
group_name,
"-o",
str(output_file),
)

session.log(f"✓ Created {output_file}")
Loading
Loading