Skip to content

Support Python 3.15 with platform-aware optional PyTorch dependencies - #177

Merged
eggpig merged 2 commits into
pybind11from
release/python-315-optional-torch
Oct 12, 2026
Merged

eggpig merged 2 commits into
pybind11from
release/python-315-optional-torch

Conversation

@eggpig

@eggpig eggpig commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Python 3.15 users currently cannot install EasyGraph with the required PyTorch dependency. This prepares version 1.6.3 for Python 3.8–3.15: compatible CPython/platform combinations install PyTorch automatically, while combinations without a published compatible wheel can use the core graph and C++ APIs and receive one import-time notice linking to the official PyTorch installer.

The dependency policy is a checked-in PyPI wheel snapshot, refreshed explicitly by scripts/check_pytorch_support.py; package builds do not make network compatibility queries. The policy accounts for Python version, OS, architecture, and older Torch/NumPy ABI constraints, and records minimum macOS versions for release review. Pip selects compatible OS versions from wheel platform tags; avoiding kernel-version comparisons keeps metadata compatible with older pip on Linux. Tensor-dependent features fail with a clear installation message when Torch is absent, while errors inside an installed Torch package remain visible.

CI builds and exercises installed packages on Windows, Linux, Intel Mac, and Apple Silicon Mac with Python 3.9, 3.12, 3.14, and 3.15. Wheel publishing retains the legacy builder for Python 3.8–3.13 and adds a current builder for 3.14–3.15. scripts/PYTHON_RELEASE.md documents the repeatable release procedure.

Validation before this PR:

  • Built native macOS arm64 wheels with Python 3.14.8 and 3.15.0.
  • Fresh Python 3.14 install selected Torch automatically; NumPy/Torch conversion and hypergraph aggregation passed.
  • Fresh Python 3.15 install imported without Torch, emitted one notice, and passed C++ graph, PageRank, centrality, and SciPy conversion checks.
  • 77 existing graph tests passed in each Python environment; 23 dependency-policy and optional-import tests passed.

All 22 GitHub Actions jobs passed for commit c823ed9cb62ce62320399b11ddcdb0414fec373b:

  • Build and smoke checks: all 16 Windows, Linux, Intel Mac, and Apple Silicon Mac / Python 3.9, 3.12, 3.14, and 3.15 combinations passed native compilation, installed-package imports, graph functions, and optional-dependency checks.
  • Existing pytest suite: Python 3.8–3.12 each passed 793 tests, with 22 existing conditional skips.
  • Formatting: pre-commit passed.

Publishing remains a separate manual step after merge.

@eggpig
eggpig merged commit 4274f3d into pybind11 Oct 12, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant