Skip to content

Sync python-bindings with the updated tutorial - #945

Merged
realpython-bot merged 1 commit into
masterfrom
maintenance/python-bindings-overview-20261116
Nov 16, 2026
Merged

realpython-bot merged 1 commit into
masterfrom
maintenance/python-bindings-overview-20261116

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Syncs python-bindings/ with the maintenance update of Python Bindings: Calling C or C++ From Python.

Changes

  • requirements.txt: re-pinned to the article's updated dependencies field (cffi 2.1.1, Cython 3.3.1, invoke 3.0.3, pybind11 3.1.0) plus pycparser 3.12. Added setuptools==84.2.1, because CFFI's ffi.compile() raises "This CFFI feature requires setuptools on Python >= 3.12" without it (distutils was removed in 3.12).
  • tasks.py: compile_python_module() now adds `python3-config --includes` before -I ., matching the updated build command shown in the article.

Verification

  • Fresh venv on Python 3.12.3 (Ubuntu 24.04, gcc/g++, python3-dev) from requirements.txt, then invoke all: ctypes (C and C++), CFFI, PyBind11, and Cython all built and printed return val 13.8.
  • Same venv without setuptools: invoke build-cffi fails, which is why it's pinned.
  • ruff@0.14.1 format --check and ruff@0.14.1 check pass.

Article draft: https://realpython.com/pbjt/blog/post/2651/change/
Maintenance card: https://trello.com/c/GnPLhPAQ

🤖 Generated with Claude Code

…Calling C or C++ From Python

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realpython-bot
realpython-bot merged commit 6397294 into master Nov 16, 2026
1 check passed
@realpython-bot
realpython-bot deleted the maintenance/python-bindings-overview-20261116 branch November 16, 2026 07:02
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