Skip to content

Commit

Permalink
Python 3.13.0b1 support
Browse files Browse the repository at this point in the history
* Prefer Cython3+ `old_build_ext`; required for 3.13+
  • Loading branch information
nitzmahone committed May 10, 2024
1 parent 48838a3 commit a61f899
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[build-system]
requires = ["setuptools", "wheel", "Cython<3.0"]
requires = [
"setuptools", # FIXME: declare min/max setuptools versions?
"wheel",
"Cython; python_version < '3.13'",
"Cython>=3.0; python_version >= '3.13'"
]
build-backend = "setuptools.build_meta"
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down Expand Up @@ -82,7 +84,12 @@
with_cython = True
try:
from Cython.Distutils.extension import Extension as _Extension
from Cython.Distutils import build_ext as _build_ext
try:
# try old_build_ext from Cython > 3 first, until we can dump it entirely
from Cython.Distutils.old_build_ext import old_build_ext as _build_ext
except ImportError:
# Cython < 3
from Cython.Distutils import build_ext as _build_ext
with_cython = True
except ImportError:
if with_cython:
Expand Down

0 comments on commit a61f899

Please sign in to comment.