From 2a462c35c935e050ca0551798ae1d7b19a099169 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 29 Jun 2026 14:58:41 -0600 Subject: [PATCH 1/5] Update version numbers to prepare for v2.1 release --- doc/source/conf.py | 4 ++-- doc/source/installation.rst | 4 ++-- pyproject.toml | 5 ++--- src/c/_cffi_backend.c | 2 +- src/c/test_c.py | 2 +- src/cffi/__init__.py | 4 ++-- src/cffi/_embedding.h | 2 +- testing/cffi1/cffi_gen_src_examples/common/pyproject.toml | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 075336b7..48b46e88 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -43,9 +43,9 @@ # built documents. # # The short X.Y version. -version = '2.0' +version = '2.1' # The full version, including alpha/beta/rc tags. -release = '2.0.1.dev0' +release = '2.1.0.dev0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/installation.rst b/doc/source/installation.rst index f94de7ec..e3baf535 100644 --- a/doc/source/installation.rst +++ b/doc/source/installation.rst @@ -17,7 +17,7 @@ platform as well as on Windows 32 and 64. (It relies occasionally on libffi, so it depends on libffi being bug-free; this may not be fully the case on some of the more exotic platforms.) -CFFI is tested with CPython 3.8-3.12. +CFFI is tested with CPython 3.10-3.15. The core speed of CFFI is better than ctypes, with import times being either lower if you use the post-1.0 features, or much higher if you @@ -29,7 +29,7 @@ libraries on PyPy. Requirements: -* CPython 3.8+, or PyPy (PyPy 2.0 for the earliest +* CPython 3.10+, or PyPy (PyPy 2.0 for the earliest versions of CFFI; or PyPy 2.6 for CFFI 1.0). * in some cases you need to be able to compile C extension modules. diff --git a/pyproject.toml b/pyproject.toml index e09d0b3b..3e446743 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,11 +7,11 @@ build-backend = "setuptools.build_meta" [project] name = "cffi" -version = "2.0.1.dev0" +version = "2.1.0.dev0" dependencies = [ "pycparser; implementation_name != 'PyPy'", ] -requires-python = ">=3.9" +requires-python = ">=3.10" description = "Foreign Function Interface for Python calling C code." readme = "README.md" @@ -20,7 +20,6 @@ license-files = ["LICENSE"] classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/src/c/_cffi_backend.c b/src/c/_cffi_backend.c index 6a2d4957..cf1f33fd 100644 --- a/src/c/_cffi_backend.c +++ b/src/c/_cffi_backend.c @@ -2,7 +2,7 @@ #include #include "structmember.h" #include "misc_thread_common.h" -#define CFFI_VERSION "2.0.1.dev0" +#define CFFI_VERSION "2.1.0.dev0" #ifdef MS_WIN32 #include diff --git a/src/c/test_c.py b/src/c/test_c.py index b953464f..49b2e1bb 100644 --- a/src/c/test_c.py +++ b/src/c/test_c.py @@ -66,7 +66,7 @@ def _capture_unraisable_hook(ur_args): # ____________________________________________________________ import sys -assert __version__ == "2.0.1.dev0", ("This test_c.py file is for testing a version" +assert __version__ == "2.1.0.dev0", ("This test_c.py file is for testing a version" " of cffi that differs from the one that we" " get from 'import _cffi_backend'") if sys.version_info < (3,): diff --git a/src/cffi/__init__.py b/src/cffi/__init__.py index 1b5cfe24..b5fd9c9b 100644 --- a/src/cffi/__init__.py +++ b/src/cffi/__init__.py @@ -5,8 +5,8 @@ from .error import CDefError, FFIError, VerificationError, VerificationMissing from .error import PkgConfigError -__version__ = "2.0.1.dev0" -__version_info__ = (2, 0, 1, 'dev0') +__version__ = "2.1.0.dev0" +__version_info__ = (2, 1, 0, 'dev0') # The verifier module file names are based on the CRC32 of a string that # contains the following version number. It may be older than __version__ diff --git a/src/cffi/_embedding.h b/src/cffi/_embedding.h index eb9f17eb..a1d96f01 100644 --- a/src/cffi/_embedding.h +++ b/src/cffi/_embedding.h @@ -222,7 +222,7 @@ static int _cffi_initialize_python(void) if (f != NULL && f != Py_None) { PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME - "\ncompiled with cffi version: 2.0.1.dev0" + "\ncompiled with cffi version: 2.1.0.dev0" "\n_cffi_backend module: ", f); modules = PyImport_GetModuleDict(); mod = PyDict_GetItemString(modules, "_cffi_backend"); diff --git a/testing/cffi1/cffi_gen_src_examples/common/pyproject.toml b/testing/cffi1/cffi_gen_src_examples/common/pyproject.toml index 45b21900..28d6fbdc 100644 --- a/testing/cffi1/cffi_gen_src_examples/common/pyproject.toml +++ b/testing/cffi1/cffi_gen_src_examples/common/pyproject.toml @@ -6,5 +6,5 @@ requires = ['meson-python', 'cffi'] name = 'squared' version = '0.1.0' description = 'Small self-contained example project that builds a CFFI extension via meson-python.' -requires-python = '>=3.9' +requires-python = '>=3.10' dependencies = ['cffi'] From 464b30a3cf86e0f6132793dbfe6a000f74953c19 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 29 Jun 2026 15:15:07 -0600 Subject: [PATCH 2/5] Delete missed cp39 Windows builds --- .github/workflows/ci.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3e29a5d6..6eb872ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -312,7 +312,6 @@ jobs: matrix_yaml: | include: # x86_64 windows - - { spec: cp39-win_amd64, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp310-win_amd64, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp311-win_amd64, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp312-win_amd64, omit: ${{ env.skip_ci_redundant_jobs }} } @@ -323,7 +322,6 @@ jobs: - { spec: cp315t-win_amd64 } # x86 windows - - { spec: cp39-win32, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp310-win32, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp311-win32, omit: ${{ env.skip_ci_redundant_jobs }} } - { spec: cp312-win32, omit: ${{ env.skip_ci_redundant_jobs }} } From 8df8f09079003984eca89eb3157bb8446047e504 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Mon, 29 Jun 2026 15:53:37 -0600 Subject: [PATCH 3/5] Update changelog --- doc/source/whatsnew.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index ef37f142..89ff036f 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -2,8 +2,24 @@ What's New ====================== -v2.0.0.dev0 -============ +v2.1.0.dev0 +=========== + +* Added support for arm64 iOS wheels. (`#181`_) +* Dropped support for Python 3.9. +* Added support for Python 3.15 and support for C extensions generated by CFFI to target the new ``abi3t`` free-threaded ABI. (`#232`_) +* Avoid crashes inside of ``__delitem__``. (`#235`_) +* Avoid "string too big" error under MSVC. (`#167`_) +* Fix mingw builds. (`#198`_) + +.. _`#167`: https://github.com/python-cffi/cffi/pull/167 +.. _`#181`: https://github.com/python-cffi/cffi/pull/181 +.. _`#198`: https://github.com/python-cffi/cffi/pull/198 +.. _`#232`: https://github.com/python-cffi/cffi/pull/232 +.. _`#235`: https://github.com/python-cffi/cffi/pull/235 + +v2.0.0 +====== * Added support for free threaded Python. (`#178`_) Note that the free-threaded build does not yet support building extensions From 4db93caf4c2f160add0c5be35bd8563c31acb506 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Tue, 30 Jun 2026 08:21:41 -0600 Subject: [PATCH 4/5] Make error message when embedding version test fails more friendly --- testing/cffi0/test_version.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testing/cffi0/test_version.py b/testing/cffi0/test_version.py index 3ece252a..ad952342 100644 --- a/testing/cffi0/test_version.py +++ b/testing/cffi0/test_version.py @@ -59,4 +59,8 @@ def test_embedding_h(): v = cffi.__version__ p = cffi_root / 'src/cffi/_embedding.h' content = _read(p) - assert ('cffi version: %s"' % (v,)) in content + loc = content.find('cffi version: ') + assert loc > 0, "Cannot find cffi version string in _embedding.h" + context = content[loc-100:loc+100] + msg = f"CFFI verison is incorrect, context for current version string is:\n{context}" + assert (f'cffi version: {v}"') in context, msg From c59670b1e401c7d9b0efb2b504fcdfe055203b73 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Tue, 30 Jun 2026 08:25:41 -0600 Subject: [PATCH 5/5] Move cffi-gen-src release note to 2.1.0 notes --- doc/source/whatsnew.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 89ff036f..265fa46e 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -5,9 +5,15 @@ What's New v2.1.0.dev0 =========== +* Added the ``cffi-gen-src`` command-line tool (also invocable as + ``python -m cffi.gen_src``), which generates CFFI C extension + source code, so that a build backend such as `meson-python`_ can build + the extension. See :doc:`cffi-gen-src` for details. Integrated from the + `cffi-buildtool`_ project by Rose Davidson. (`#241`_) * Added support for arm64 iOS wheels. (`#181`_) * Dropped support for Python 3.9. -* Added support for Python 3.15 and support for C extensions generated by CFFI to target the new ``abi3t`` free-threaded ABI. (`#232`_) +* Added support for Python 3.15 and support for C extensions generated by CFFI + to target the new ``abi3t`` free-threaded ABI. (`#232`_) * Avoid crashes inside of ``__delitem__``. (`#235`_) * Avoid "string too big" error under MSVC. (`#167`_) * Fix mingw builds. (`#198`_) @@ -17,6 +23,7 @@ v2.1.0.dev0 .. _`#198`: https://github.com/python-cffi/cffi/pull/198 .. _`#232`: https://github.com/python-cffi/cffi/pull/232 .. _`#235`: https://github.com/python-cffi/cffi/pull/235 +.. _`#241`: https://github.com/python-cffi/cffi/pull/241 v2.0.0 ====== @@ -26,12 +33,6 @@ v2.0.0 with the limited API, so you must set py_limited_api=False when building extensions for the free-threaded build. * Added support for Python 3.14. (`#177`_) -* Added the ``cffi-gen-src`` command-line tool (also invocable as - ``python -m cffi.gen_src``), which generates CFFI C extension - source code, so that a build backend such as `meson-python`_ can build - the extension. See :doc:`cffi-gen-src` for details. Integrated from the - `cffi-buildtool`_ project by Rose Davidson. -* WIP .. _`meson-python`: https://meson-python.readthedocs.io/ .. _`cffi-buildtool`: https://github.com/inklesspen/cffi-buildtool