#1152327 python3-contourpy: per-interpreter _build_config.py does not work as intended

Package:
python3-contourpy
Source:
python3-contourpy
Description:
Python library for calculating contours of 2D quadrilateral grids
Submitter:
Stuart Prescott
Date:
2026-10-28 01:05:02 UTC
Severity:
normal
#1152327#5
Date:
2026-10-28 01:02:41 UTC
From:
To:
Dear Maintainer,

In addressing #1152191, the per-interpreter differences of _build_config.py
being unable to be merged into a single dist-packages were solved by keeping
both files:

$ dpkg -L python3-contourpy |grep build
/usr/lib/python3/dist-packages/contourpy/util/_build_config.py
/usr/lib/python3.15/dist-packages/contourpy/util/_build_config.py

where the two files have differing contents that record the interpreters
used etc. (They also capture the build path btw)

$ grep python_version /usr/lib/python3*/dist-packages/contourpy/util/_build_config.py
/usr/lib/python3.15/dist-packages/contourpy/util/_build_config.py:        python_version="3.15",
/usr/lib/python3/dist-packages/contourpy/util/_build_config.py:        python_version="3.14",

While Python does have the ability to use the per-interpreter
dist-packages fallback, that doesn't work for individual files:

$ python3.14 -c'from contourpy.util import _build_config; print(_build_config.build_config()["python_version"])'
3.14

$ python3.15 -c'from contourpy.util import _build_config; print(_build_config.build_config()["python_version"])'
3.14

i.e. Python 3.15 is not getting the data from the module in
python3.15/dist-packages as intended.

It's not clear to me that _build_config.py is actually useful enough to
worry about fixing this properly, and so just removing versions that are
not for the default interpreter would be a simple solution. This file is
"FYI" rather than something like pkgconf for being able to compile other
packages.

If it is considered important enough to keep, then having a common
_build_config.py file that loads the data from a per-interpreter file
such as _build_config_{pyver}.json; this should be easy enough to do with the
existing mesonpy templating, and the resultant set of files would mergeable
into a single dist-packages tree by dh_python3.

regards
Stuart