Re: [ITP] python-pybind11

Jon Turney via Cygwin-apps <[email protected]> Sun, 15 Mar 2026 16:41:40 +0000
Newsgroups gmane.os.cygwin.applications
Message-ID <[email protected]>
On 15/03/2026 15:52, Hamish McIntyre-Bhatty via Cygwin-apps wrote:
> Hi all,
> 
> pybind11 (https://pypi.org/project/pybind11/) is a dependency of recent 
> versions of python-imaging (a package I already maintain), and as such 
> I'd like to package it for Cygwin.
> 
> The Cygport file is available at: https://gitlab.com/hamishmb/cygwin- 
> python-pybind11.
> 
> pybind11 is in Debian: https://packages.debian.org/trixie/python3-pybind11

Thanks! I added this to your packages.

A few small comments on the cygport:
  > PYTHON_WHEEL_VERSIONS="3.9:3.12"

This is the default, and leaving it implicit will avoid the need to 
change it in future.

> PKG_NAMES="python-pybind11-common python39-pybind11 python312-pybind11"
[...]
> python39_pybind11_REQUIRES="python39"
> python312_pybind11_REQUIRES="python312"

You can write this as (something like):

> PKG_NAMES="python-pybind11-common"
> 
> for v in ${PYTHON_WHEEL_VERSIONS//:/ }
> do
>   PKG_NAMES+=" python${v/./}"
>   declare python${v/./}_REQUIRES+="python${v}"
> done

I'm not sure about this part:

> python_pybind11_common_REQUIRES="python39-pybind11 python312-pybind11"
> python_pybind11_common_CONTENTS="
>     usr/bin/
> "

Maybe the name should just be python-pybind11, or even pybind11, if it 
installs a tool of that name?

I'm not sure about the arrangement of depending on 
python3{9,12}-pybind11 (and thus pulling in *both* python39 and 
python312) to ensure that the script works irrespective of what 
/usr/bin/python currently is).

(In fact, because python-wheel installs /usr/bin/pybind11-config for 
each python version, we might well end up with it containing an 
explicitly versioned shebang for the last one it made, anyhow)


So, all in all, maybe it makes more sense to build this with the 
python3-wheel cygclass? (which only builds the package for a single 
version of python, the default, which is 3.9 currently) - especially if 
the primary way to use this is via the script, and the python module 
isn't expected to be used elsewhere.