SlideShare a Scribd company logo
Projects report - @henryiii
Henry Schreiner - 11-13-2023
https://iscinumpy.dev
ScientiïŹc-Python
Development Guide
Built from the Scikit-HEP work at the
2023 ScientiïŹc-Python Developer’s
Summit
Merged with cookie & sp-repo-review
from Scikit-HEP (later slides)
Over a dozen in-depth guide page on
topics like producing compiled wheels
in GitHub Actions
Kept up to date with the latest
recommendations (like PyPI Trusted
Publishers and ruff-format tabs)
Recently featured on Python Bytes and
The Real Python Podcast!
ScientiïŹc-Python
Development Guide
Built from the Scikit-HEP work at the
2023 ScientiïŹc-Python Developer’s
Summit
Merged with cookie & sp-repo-review
from Scikit-HEP (later slides)
Over a dozen in-depth guide page on
topics like producing compiled wheels
in GitHub Actions
Kept up to date with the latest
recommendations (like PyPI Trusted
Publishers and ruff-format tabs)
Recently featured on Python Bytes and
The Real Python Podcast!
ScientiïŹc-Python
Development Guide
Built from the Scikit-HEP work at the
2023 ScientiïŹc-Python Developer’s
Summit
Merged with cookie & sp-repo-review
from Scikit-HEP (later slides)
Over a dozen in-depth guide page on
topics like producing compiled wheels
in GitHub Actions
Kept up to date with the latest
recommendations (like PyPI Trusted
Publishers and ruff-format tabs)
Recently featured on Python Bytes and
The Real Python Podcast!
ScientiïŹc-Python cookie
pipx run cookiecutter gh:scientific-python/cookie
Optional, but learn pipx if you
don’t already use it daily!
Or copier, or cruft
ScientiïŹc-Python
cookie
Over 10 build backends, including
compiled C++ or Rust
Selection of license and VCS
versioning (most backends)
In-sync with Development Guide (some
parts actually rendered into the guide)
Generation tested with nox in CI
Pre-commit & GHA updated weekly
repo-review &
sp-repo-review
repo-review: unbiased Python 3.10+
framework for checking repo
conïŹguration (no checks)
sp-repo-review: plugin with checks
based on the dev guide (part of the
same repo, like cookie)
Checks are linked to matching badges
throughout the guide
Runs in WebAssembly too, so
embedded directly in the guide too!
Validate-pyproject also has plugin
I’m working on the
Python & C++
development story
And a lot has and is happening

Overall Picture
I’m working on each part.
Bindings to
CPython / PyPy
Build system C++ code
Binary
Redistributable
binaries
Build tool(s)
Build
conïŹguration
pybind11
(& nanobind)
The “missing” C++ bindings for
CPython/PyPy
Header-only, zero dependency
Supports NumPy without the headers
Great CMake & Meson support
Three example repos (setuptools,
CMake, scikit-build-core build
systems)
Extensive CI testing & static checks
Used by SciPy, PyTorch, Google, etc.
C++17, CPython 3.8+
Only simple C++ constructs
(design for bindings)
Limited API / Stable ABI 3.12+
#include <pybind11/pybind11.h>
namespace py = pybind11;
int add(int i, int j) {
return i + j;
}
PYBIND11_MODULE(python_example, m) {
m.def("add", &add);
m.def("subtract", [](int i, int j) { return i - j; });
}
BONUS project: I’m not a maintainer, but help out occasionally
scikit-build
CMake - Python bridge for building
extensions
50% of my time for three years (NSF
grant)
Introduced scikit-build-core last year:
modern, static-conïŹg backend
Over 200 users now (vs. ~900
scikit-build classic users)
Family of tools: scikit-build (classic),
scikit-build-core, cmake, ninja,
moderncmakedomain, etc.
[build-system]
requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"
[project]
name = "example"
version = "0.0.1"
cmake_minimum_required(VERSION 3.guatda.com/cmx.p15...3.27)
project(example LANGUAGES C)
find_package(Python REQUIRED COMPONENTS
Interpreter Development.Module REQUIRED)
Python_add_library(_module MODULE src/module.c WITH_SOABI)
install(TARGETS _module DESTINATION example)
pyproject.toml
CMakeLists.txt
scikit-build-core: features
Powerful conïŹg system
Impl: declarative dataclasses + transformer
- Pyproject, conïŹg-settings, and env
- Generates JSONSchema
- Generates readme docs
Overrides (like cibuildwheel & mypy)
Automatic cmake/ninja
Only adds the wheels as build dependencies
if required (not on system already)
- Supports WebAssembly, BSD, etc.
- Can set min CMake version required
Features hard with setuptools
Conditional Stable ABI / Limited ABI
macOS compatibility tags
Write to optional wheel dirs (ex: headers)
Experimental editable mode, with auto-rebuild
Extra goodies
Auto inclusion of site-packages in preïŹx path
Entry points for custom CMake modules
FindPython auto-backport
Dynamic metadata plugin system
build
pipx run build
The oïŹƒcial replacement for python setup.py sdist and pip wheel .
Released 1.0!
Supports any backend
cibuildwheel
Builds wheels on CI and locally
CPython 3.6-3.12, PyPy 3.7-3.10
macOS, Windows, manylinux, musllinux
All OS’s: 64-bit Intel, 32-bit Intel, ARM
Linux: ppc64le & s390x too (emulated)
Tested on GHA, Azure, Travis, AppVeyor,
Circle CI, GitLab CI, Cirrus CI
ConïŹg via env or pyproject.toml
Can run tests after building wheel
See my blog for recipe to auto-generate
build matrix!
on: [push, pull_request]
jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.16.2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
.github/workflows/wheel.yml
pyproject.toml
[tool.cibuildwheel]
test-extras = ["test"]
test-command = "pytest {project}/tests"
My other projects
github.com/henryiii
iscinumpy.dev
scikit-hep.org
Boost-histogram, Hist, UHI, and
uproot-browser (Histograms in Python)
CLI11: C++’s most powerful argument
parser

More Related Content

PDF
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
PDF
SciPy 2025 - Packaging a Scientific Python Project
PDF
Digital RSE: automated code quality checks - RSE group meeting
PDF
Software Quality Assurance Tooling - Wintersession 2024
PDF
project_proposal_osrf
PDF
Intro to Github Actions @likecoin
PPTX
Yocto Project introduction
PDF
ëčˆìŠ€í†Ą ìČ«ìžìƒ with Git
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
SciPy 2025 - Packaging a Scientific Python Project
Digital RSE: automated code quality checks - RSE group meeting
Software Quality Assurance Tooling - Wintersession 2024
project_proposal_osrf
Intro to Github Actions @likecoin
Yocto Project introduction
ëčˆìŠ€í†Ą ìČ«ìžìƒ with Git

Similar to Princeton RSE Peer network first meeting (20)

PDF
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
 
PDF
Make an Instant Website with Webhooks
PDF
Let's build Developer Portal with Backstage
 
PDF
Modern binary build systems - PyCon 2024
PDF
Princeton RSE: Building Python Packages (+binary)
PDF
Gitlab and Lingvokot
PDF
Software Quality Assurance Tooling 2023
PDF
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
PPTX
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
PDF
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
PPTX
database.pptx
PPTX
GitHub Actions (Nakov at RuseConf, Sept 2022)
PDF
Pybind11 - SciPy 2021
PDF
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
PDF
Why so continuous
PDF
Productionizing Machine Learning - Bigdata meetup 5-06-2019
PPTX
carrow - Go bindings to Apache Arrow via C++-API
PDF
Apache Calcite (a tutorial given at BOSS '21)
PDF
Amazing vue.js projects that are open source and free.
PDF
Princeton Wintersession: Software Quality Assurance Tooling
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
 
Make an Instant Website with Webhooks
Let's build Developer Portal with Backstage
 
Modern binary build systems - PyCon 2024
Princeton RSE: Building Python Packages (+binary)
Gitlab and Lingvokot
Software Quality Assurance Tooling 2023
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Building A Distributed Build System at Google Scale (StrangeLoop 2016)
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
database.pptx
GitHub Actions (Nakov at RuseConf, Sept 2022)
Pybind11 - SciPy 2021
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Why so continuous
Productionizing Machine Learning - Bigdata meetup 5-06-2019
carrow - Go bindings to Apache Arrow via C++-API
Apache Calcite (a tutorial given at BOSS '21)
Amazing vue.js projects that are open source and free.
Princeton Wintersession: Software Quality Assurance Tooling
Ad

More from Henry Schreiner (20)

PDF
Tools That Help You Write Better Code - 2025 Princeton Software Engineering S...
PDF
Tools to help you write better code - Princeton Wintersession
PDF
Learning Rust with Advent of Code 2023 - Princeton
PDF
The two flavors of Python 3.13 - PyHEP 2024
PDF
What's new in Python 3.11
PDF
Everything you didn't know you needed
PDF
SciPy 2022 Scikit-HEP
PDF
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PDF
PyCon2022 - Building Python Extensions
PDF
boost-histogram / Hist: PyHEP Topical meeting
PDF
CMake best practices
PDF
RDM 2020: Python, Numpy, and Pandas
PDF
HOW 2019: Machine Learning for the Primary Vertex Reconstruction
PDF
HOW 2019: A complete reproducible ROOT environment in under 5 minutes
PDF
ACAT 2019: A hybrid deep learning approach to vertexing
PDF
2019 CtD: A hybrid deep learning approach to vertexing
PDF
2019 IRIS-HEP AS workshop: Boost-histogram and hist
PDF
IRIS-HEP: Boost-histogram and Hist
PDF
2019 IRIS-HEP AS workshop: Particles and decays
PDF
IRIS-HEP Retreat: Boost-Histogram Roadmap
Tools That Help You Write Better Code - 2025 Princeton Software Engineering S...
Tools to help you write better code - Princeton Wintersession
Learning Rust with Advent of Code 2023 - Princeton
The two flavors of Python 3.13 - PyHEP 2024
What's new in Python 3.11
Everything you didn't know you needed
SciPy 2022 Scikit-HEP
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PyCon2022 - Building Python Extensions
boost-histogram / Hist: PyHEP Topical meeting
CMake best practices
RDM 2020: Python, Numpy, and Pandas
HOW 2019: Machine Learning for the Primary Vertex Reconstruction
HOW 2019: A complete reproducible ROOT environment in under 5 minutes
ACAT 2019: A hybrid deep learning approach to vertexing
2019 CtD: A hybrid deep learning approach to vertexing
2019 IRIS-HEP AS workshop: Boost-histogram and hist
IRIS-HEP: Boost-histogram and Hist
2019 IRIS-HEP AS workshop: Particles and decays
IRIS-HEP Retreat: Boost-Histogram Roadmap
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Online Work Permit System for Fast Permit Processing
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Introduction to Artificial Intelligence
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
AI in Product Development-omnex systems
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
medical staffing services at VALiNTRY
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Online Work Permit System for Fast Permit Processing
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction to Artificial Intelligence
Design an Analysis of Algorithms I-SECS-1021-03
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
AI in Product Development-omnex systems
Operating system designcfffgfgggggggvggggggggg
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Understanding Forklifts - TECH EHS Solution
How to Choose the Right IT Partner for Your Business in Malaysia
Wondershare Filmora 15 Crack With Activation Key [2025
Navsoft: AI-Powered Business Solutions & Custom Software Development
PTS Company Brochure 2025 (1).pdf.......
ManageIQ - Sprint 268 Review - Slide Deck
medical staffing services at VALiNTRY
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Nekopoi APK 2025 free lastest update
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...

Princeton RSE Peer network first meeting

  • 1. Projects report - @henryiii Henry Schreiner - 11-13-2023 https://iscinumpy.dev
  • 2. ScientiïŹc-Python Development Guide Built from the Scikit-HEP work at the 2023 ScientiïŹc-Python Developer’s Summit Merged with cookie & sp-repo-review from Scikit-HEP (later slides) Over a dozen in-depth guide page on topics like producing compiled wheels in GitHub Actions Kept up to date with the latest recommendations (like PyPI Trusted Publishers and ruff-format tabs) Recently featured on Python Bytes and The Real Python Podcast!
  • 3. ScientiïŹc-Python Development Guide Built from the Scikit-HEP work at the 2023 ScientiïŹc-Python Developer’s Summit Merged with cookie & sp-repo-review from Scikit-HEP (later slides) Over a dozen in-depth guide page on topics like producing compiled wheels in GitHub Actions Kept up to date with the latest recommendations (like PyPI Trusted Publishers and ruff-format tabs) Recently featured on Python Bytes and The Real Python Podcast!
  • 4. ScientiïŹc-Python Development Guide Built from the Scikit-HEP work at the 2023 ScientiïŹc-Python Developer’s Summit Merged with cookie & sp-repo-review from Scikit-HEP (later slides) Over a dozen in-depth guide page on topics like producing compiled wheels in GitHub Actions Kept up to date with the latest recommendations (like PyPI Trusted Publishers and ruff-format tabs) Recently featured on Python Bytes and The Real Python Podcast!
  • 5. ScientiïŹc-Python cookie pipx run cookiecutter gh:scientific-python/cookie Optional, but learn pipx if you don’t already use it daily! Or copier, or cruft
  • 6. ScientiïŹc-Python cookie Over 10 build backends, including compiled C++ or Rust Selection of license and VCS versioning (most backends) In-sync with Development Guide (some parts actually rendered into the guide) Generation tested with nox in CI Pre-commit & GHA updated weekly
  • 7. repo-review & sp-repo-review repo-review: unbiased Python 3.10+ framework for checking repo conïŹguration (no checks) sp-repo-review: plugin with checks based on the dev guide (part of the same repo, like cookie) Checks are linked to matching badges throughout the guide Runs in WebAssembly too, so embedded directly in the guide too! Validate-pyproject also has plugin
  • 8. I’m working on the Python & C++ development story And a lot has and is happening

  • 9. Overall Picture I’m working on each part. Bindings to CPython / PyPy Build system C++ code Binary Redistributable binaries Build tool(s) Build conïŹguration
  • 10. pybind11 (& nanobind) The “missing” C++ bindings for CPython/PyPy Header-only, zero dependency Supports NumPy without the headers Great CMake & Meson support Three example repos (setuptools, CMake, scikit-build-core build systems) Extensive CI testing & static checks Used by SciPy, PyTorch, Google, etc. C++17, CPython 3.8+ Only simple C++ constructs (design for bindings) Limited API / Stable ABI 3.12+ #include <pybind11/pybind11.h> namespace py = pybind11; int add(int i, int j) { return i + j; } PYBIND11_MODULE(python_example, m) { m.def("add", &add); m.def("subtract", [](int i, int j) { return i - j; }); } BONUS project: I’m not a maintainer, but help out occasionally
  • 11. scikit-build CMake - Python bridge for building extensions 50% of my time for three years (NSF grant) Introduced scikit-build-core last year: modern, static-conïŹg backend Over 200 users now (vs. ~900 scikit-build classic users) Family of tools: scikit-build (classic), scikit-build-core, cmake, ninja, moderncmakedomain, etc. [build-system] requires = ["scikit-build-core"] build-backend = "scikit_build_core.build" [project] name = "example" version = "0.0.1" cmake_minimum_required(VERSION 3.guatda.com/cmx.p15...3.27) project(example LANGUAGES C) find_package(Python REQUIRED COMPONENTS Interpreter Development.Module REQUIRED) Python_add_library(_module MODULE src/module.c WITH_SOABI) install(TARGETS _module DESTINATION example) pyproject.toml CMakeLists.txt
  • 12. scikit-build-core: features Powerful conïŹg system Impl: declarative dataclasses + transformer - Pyproject, conïŹg-settings, and env - Generates JSONSchema - Generates readme docs Overrides (like cibuildwheel & mypy) Automatic cmake/ninja Only adds the wheels as build dependencies if required (not on system already) - Supports WebAssembly, BSD, etc. - Can set min CMake version required Features hard with setuptools Conditional Stable ABI / Limited ABI macOS compatibility tags Write to optional wheel dirs (ex: headers) Experimental editable mode, with auto-rebuild Extra goodies Auto inclusion of site-packages in preïŹx path Entry points for custom CMake modules FindPython auto-backport Dynamic metadata plugin system
  • 13. build pipx run build The oïŹƒcial replacement for python setup.py sdist and pip wheel . Released 1.0! Supports any backend
  • 14. cibuildwheel Builds wheels on CI and locally CPython 3.6-3.12, PyPy 3.7-3.10 macOS, Windows, manylinux, musllinux All OS’s: 64-bit Intel, 32-bit Intel, ARM Linux: ppc64le & s390x too (emulated) Tested on GHA, Azure, Travis, AppVeyor, Circle CI, GitLab CI, Cirrus CI ConïŹg via env or pyproject.toml Can run tests after building wheel See my blog for recipe to auto-generate build matrix! on: [push, pull_request] jobs: build_wheels: runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v4 - uses: pypa/cibuildwheel@v2.16.2 - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl .github/workflows/wheel.yml pyproject.toml [tool.cibuildwheel] test-extras = ["test"] test-command = "pytest {project}/tests"
  • 15. My other projects github.com/henryiii iscinumpy.dev scikit-hep.org Boost-histogram, Hist, UHI, and uproot-browser (Histograms in Python) CLI11: C++’s most powerful argument parser