Skip to content

Commit 48906ad

Browse files
authored
Remove Python 3.9 support and the legacy retworkx import (#1509)
* Remove retworkx and Python 3.9 support * Add release notes for Python 3.9 EoL * Add retworkx removal release note * Drop 3.9 support in pyproject.toml and uv * Bump other 39 -> 310 related things * use 3.14 not 3.14-dev * Move note to upgrade * Use macos-15-intel for tests * Update wheels.yml to use macos-15-intel
1 parent 21170c4 commit 48906ad

File tree

17 files changed

+109
-840
lines changed

17 files changed

+109
-840
lines changed

.github/workflows/docs_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.10'
21+
python-version: '3.12'
2222
- name: Install dependencies
2323
run: |
2424
pip install -U --group testinfra

.github/workflows/docs_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: '3.10'
22+
python-version: '3.12'
2323
- name: Install dependencies
2424
run: |
2525
pip install -U --group testinfra

.github/workflows/main.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-python@v5
2727
with:
28-
python-version: "3.10"
28+
python-version: "3.12"
2929
- run: |
3030
pip install -U --group lint
3131
- uses: dtolnay/rust-toolchain@stable
@@ -38,9 +38,9 @@ jobs:
3838
- name: Clippy
3939
run: cargo clippy --workspace --all-targets -- -D warnings
4040
- name: Black Codestyle Format
41-
run: black --check --diff rustworkx tests retworkx
41+
run: black --check --diff rustworkx tests
4242
- name: Python Lint
43-
run: ruff check rustworkx setup.py tests retworkx
43+
run: ruff check rustworkx setup.py tests
4444
- name: Check stray release notes
4545
run: python tools/find_stray_release_notes.py
4646
- name: rustworkx-core Rust Tests
@@ -61,7 +61,7 @@ jobs:
6161
strategy:
6262
matrix:
6363
rust: [stable]
64-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
64+
python-version: ["3.10", "3.11", "3.12", "3.13"]
6565
platform: [
6666
{ os: "macos-15-intel", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
6767
{ os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
@@ -70,20 +70,16 @@ jobs:
7070
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
7171
]
7272
include:
73-
# Test ARM + minimal supported Rust version
73+
# Test minimal supported Rust version
7474
- rust: 1.85.1
75-
python-version: "3.10"
75+
python-version: "3.12"
7676
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
7777
msrv: "MSRV"
78-
# Test ARM + future versions of Rust and Python
78+
# Test future versions of Rust and Python
7979
- rust: beta
80-
python-version: "3.13" # upgrade to 3.14-dev when the release candidate is available
80+
python-version: "3.14" # upgrade to 3.15-dev when the release candidate is available
8181
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
8282
msrv: "Beta"
83-
# Exclude python 3.9 on arm64 until actions/setup-python#808 is resolved
84-
exclude:
85-
- platform: {os: "macOS-14", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
86-
python-version: 3.9
8783
steps:
8884
- uses: actions/checkout@v4
8985
- name: Set up Python ${{ matrix.python-version }}
@@ -112,7 +108,7 @@ jobs:
112108
runs-on: ubuntu-latest
113109
strategy:
114110
matrix:
115-
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
111+
python-version: ["3.10", "3.11", "3.12", "3.13"]
116112
steps:
117113
- uses: actions/checkout@v4
118114
- name: Set up Python ${{ matrix.python-version }}
@@ -137,7 +133,7 @@ jobs:
137133
- name: Set up Python ${{ matrix.python-version }}
138134
uses: actions/setup-python@v5
139135
with:
140-
python-version: "3.10"
136+
python-version: "3.12"
141137
- name: Install Rust toolchain
142138
uses: dtolnay/rust-toolchain@stable
143139
with:
@@ -185,7 +181,7 @@ jobs:
185181
- name: Set up Python ${{ matrix.python-version }}
186182
uses: actions/setup-python@v5
187183
with:
188-
python-version: "3.10"
184+
python-version: "3.12"
189185
- name: Install Rust toolchain
190186
uses: dtolnay/rust-toolchain@stable
191187
- name: Install binary deps

.github/workflows/wheels.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
matrix:
50-
os: [ubuntu-latest, windows-latest, macos-13, macos-14, ubuntu-24.04-arm]
50+
os: [ubuntu-latest, windows-latest, macos-15-intel, macos-14, ubuntu-24.04-arm]
5151
steps:
5252
- uses: actions/checkout@v4
5353
- uses: actions/setup-python@v5
@@ -186,26 +186,3 @@ jobs:
186186
with:
187187
path: ./wheelhouse/*.whl
188188
name: shared-wheel-builds-win32
189-
retworkx-compat-build:
190-
name: Build retworkx
191-
runs-on: ubuntu-latest
192-
environment: release
193-
permissions:
194-
id-token: write
195-
needs: ["upload_shared_wheels"]
196-
steps:
197-
- uses: actions/checkout@v4
198-
- uses: actions/setup-python@v5
199-
name: Install Python
200-
with:
201-
python-version: '3.10'
202-
- name: Install deps
203-
run: pip install -U setuptools-rust wheel build
204-
- name: Build sdist
205-
run: pushd retworkx && python setup.py bdist_wheel && popd
206-
- uses: actions/upload-artifact@v4
207-
with:
208-
path: ./retworkx/dist/*
209-
name: sdist-retworkx
210-
- name: Publish package distributions to PyPI
211-
uses: pypa/gh-action-pypi-publish@release/v1

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ nalgebra-sparse = { version = "=0.10", features = ["io"] }
7070

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

7575
[dependencies.sprs]
7676
version = "^0.11"

noxfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def base_test(session):
2525
def test(session):
2626
base_test(session)
2727

28-
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
28+
@nox.session(python=["3.10", "3.11", "3.12", "3.13"])
2929
def test_with_version(session):
3030
base_test(session)
3131

@@ -34,7 +34,7 @@ def lint(session):
3434
black(session)
3535
typos(session)
3636
session.install(*lint_deps)
37-
session.run("ruff", "check", "rustworkx", "retworkx", "setup.py")
37+
session.run("ruff", "check", "rustworkx", "setup.py")
3838
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
3939
session.run("python", "tools/find_stray_release_notes.py")
4040

@@ -74,7 +74,7 @@ def docs_clean(session):
7474
@nox.session(python=["3"])
7575
def black(session):
7676
session.install(*[d for d in lint_deps if "black" in d])
77-
session.run("black", "rustworkx", "tests", "retworkx", *session.posargs)
77+
session.run("black", "rustworkx", "tests", *session.posargs)
7878

7979
@nox.session(python=["3"])
8080
def typos(session):

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "rustworkx"
33
version = "0.17.1"
44
description = "A High-Performance Graph Library for Python"
5-
requires-python = ">=3.9"
5+
requires-python = ">=3.10"
66
dependencies = [
77
"numpy>=1.16.0,<3"
88
]
@@ -13,7 +13,6 @@ classifiers=[
1313
"Intended Audience :: Science/Research",
1414
"Programming Language :: Rust",
1515
"Programming Language :: Python :: 3 :: Only",
16-
"Programming Language :: Python :: 3.9",
1716
"Programming Language :: Python :: 3.10",
1817
"Programming Language :: Python :: 3.11",
1918
"Programming Language :: Python :: 3.12",
@@ -29,7 +28,7 @@ packages = ["rustworkx", "rustworkx.visualization"]
2928
include-package-data = true
3029

3130
[tool.distutils.bdist_wheel]
32-
py-limited-api = "cp39"
31+
py-limited-api = "cp310"
3332

3433
[[tool.setuptools-rust.ext-modules]]
3534
target = "rustworkx.rustworkx"
@@ -105,7 +104,7 @@ releaseinfra = [
105104

106105
[tool.black]
107106
line-length = 100
108-
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
107+
target-version = ['py310', 'py311', 'py312', 'py313']
109108

110109
[tool.ruff]
111110
line-length = 105 # more lenient than black due to long function signatures
@@ -117,7 +116,7 @@ lint.select = [
117116
"PYI", # flake8-pyi
118117
"Q", # flake8-quotes
119118
]
120-
target-version = "py39"
119+
target-version = "py310"
121120
extend-exclude = ["doc"]
122121

123122
[tool.ruff.lint.per-file-ignores]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
upgrade:
3+
- |
4+
The minimum supported Python version for using rustworkx has been raised to Python 3.10.
5+
Python 3.9 has reached it's end-of-life and will no longer be supported. To use rustworkx
6+
you will need to ensure you are using Python >=3.10.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
upgrade:
3+
- |
4+
As announced in the 0.17 release, the legacy `retworkx` name has been sunset. We encourage users to depend on
5+
'rustworkx' as previously instructed.
6+
7+
Thanks to all users that have used the library since the early days before the name change!

retworkx/retworkx/__init__.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)