Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Building a Binary Extension

PyCon US via YouTube

Overview

Explore the process of building binary extensions for Python in this 40-minute PyCon US talk. Learn how to leverage the power of compiled code to enhance your Python libraries' performance and functionality. Discover modern tools and best practices for creating seamless binary extensions across various platforms. Dive into topics such as using pybind11 for C++ bindings, scikit-build for powerful CMake-based builds, and cibuildwheel for producing binaries on multiple platforms. Gain insights on automating tasks, ensuring reproducible builds, and overcoming common misconceptions about binary extensions. By the end of this talk, feel confident in incorporating compiled code into your Python projects to accelerate and advance your libraries' capabilities.

Syllabus

Intro
Is Python fast?
Python has great performance
dump Python
Numba
Make Python Faster
Pre)compile
What is a binary extension?
Pure / Binary wheels
But why compile?
Disclamers
But it's hard?
Bindings / Coding
A fork in the road
Accessing shared libraries
Not just a JIT
Fast Python
Fast not quite-Python
Example of usage
Many great features
Nanobind
Example project
tests/test_works.py
Build systems
Pybind11 and setuptools
Scikit-build plans
setup.py
Redistributables
cibuildwheel tips
pyproject. toml
github/workflows/cd.yml (1)
Produced files
Think outside the box
Quickstart: scikit-hep/cookie
Key Takeaways
My Projects

Taught by

PyCon US

Reviews

Start your review of Building a Binary Extension

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.