While it can also do much more, Python is a fantastic language for writing small scripts and utilities with it’s expressive syntax and batteries-included standard library. But what if you need just a bit more? PyPI is one of the best package repositories for any language, and being able to access it without having to write a multi-file library and setting up virtual environments would be a dream - one that is becoming reality. Pipx 1.3 has an experimental implementation of the provisionally accepted PEP 723, and I’d like to show it off here, as it’s tremendously useful for simple scripts & utilities.[Read More]
Favorite posts and series
C++ 11 14 17 20 23 • macOS (AS) / Windows Setup • Azure DevOps (Python Wheels) • Conda-Forge ROOT • CLI11 • GooFit • cibuildwheel • Hist • Python Bindings • Python 2→3 3.7 3.8 3.9 3.10 3.11 3.12 • SSH
My classes and books
pybind11 (python_example, cmake_example, scikit_build_example) • cibuildwheel • build • scikit-build (core, cmake, ninja, moderncmakedomain) • boost-histogram • Hist • UHI • Vector • GooFit • Particle • DecayLanguage • Conda-Forge ROOT • Jekyll-Indico • uproot-browser • Scientific-Python/cookie • repo-review • CLI11 • meson-python • Plumbum • validate-pyproject • pytest GHA annotate-failures • flake8-errmsg • check-sdist • beautifulhugo • POVM • hypernewsviewer
C++23 is complete and pretty much finalized, so let’s explore the new features in C++, from a data science point of view. This is not as large of a release as C++20 or C++11, but it’s still a hefty release with lots of nice new features - larger than C++17.
Some of the major new features are building on themes from C++20, such as vastly
expanded ranges and views, more
consteval, module support for the
std::print to supplement
std::format, and a
std::generator to support coroutines. There are also several general features,
lambdas and classes get along much better now, there are new preprocessor
additions (!), a stacktrace library, flat maps/sets, and new
this, and many various additions.
The Scientific Python Development Guide
One outcome of the 2023 Scientific Python Developer Summit was the Scientific Python Development Guide, a comprehensive guide to modern Python package development, complete with a new project template supporting 12 build backends and a WebAssembly-powered checker with checks linked to the guide. The guide covers topics like modern, compiled, and classic packaging, style checks, type checking, docs, task runners, CI, tests, and much more! There also are sections of tutorials, principles, and some common patterns.
This guide (along with cookie & repo-review) started in Scikit-HEP in 2020. During the summit, it was merged with the NSLS-II guidelines, which provided the basis for the principles section. I’d like to thank and acknowledge Dan Allan and Gregory Lee for working tirelessly during the summit to rework, rewrite, merge, and fix the guide, including writing most of the tutorials pages and first patterns page, and rewriting the environment page as a tutorial.[Read More]
I’ve released a new1 toolkit for running checks, similar to Ruff and Flake8
but designed to check configuration, called repo-review. It requires Python
3.10+2 to run and has no built-in checks, but is easy to write plugins for. A
set of checks based on the Scientific Python Development Guide (which I also
have a post about!) are available as a plugin,
You can run
repo-review in WebAssembly (via Pyodide), or in pre-commit, or as
a GitHub Action. It supports multiple output formats, including Rich, HTML, and
JSON. The system is based on fixtures (like pytest) and topologically sorts
requirements. You don’t need to depend on repo-review to add a repo-review
plugin. You can see a live version using sp-repo-review
or standalone here.
Python 3.12’s beta’s are out, which means the features are locked in. The theme
this year has been cleanup and typing.
distutils has been removed, and
setuptools is no longer present in default environments.
I set up an ARM DevKit recently, so I wanted to catalog what I do to setup Windows here. This is not as polished or complete as my macOS setups, because this is not something I use as a daily driver. But it might be useful, and I’m open to suggestions to improve it. This should work for Intel or ARM Windows.[Read More]