Hi Ben
On 14/10/2026 17:48, Ben Finney wrote:
>> - --test-pytest is unneeded as the explicit build-dep on
>> python3-pytest means the same thing
> So, if hypothetically another source package needs to declare
> “Build-Depends: python3-pytest”, but*not* the ‘--test-pytest’
> behaviour, what then? We need an explicit ‘--test-custom’ or the like?
yes, or a declarative PYBUILD_TEST_CUSTOM and then set PYBUILD_TEST_ARGS
to make it do what is needed.
See python-pyqtgraph as an example to run pytest within xvfb.
https://sources.debian.org/src/python-pyqtgraph/0.14.0-8/debian/rules
This overlaying of command line options and environment variables is
alluded to in the man page pybuild(1) ... I concur with your comments
about improving our documentation as I frequently find myself either
looking at codesearch.d.n to find existing practice, or pybuild's code
(which in the folding together of cli and env vars is clever... but a
simple piece of work to trace through).
On 15/10/2026 10:25, Ben Finney wrote:
- PYBUILD_INSTALL_ARGS is unneeded (it does nothing in pybuild's
pyproject-based workflow)
Because the ‘pyproject’ build system (instructing it to use a PEP %!& +
PEP 518 build system interface) causes PyBuild to ignore the
‘--install-args’ option?
Despite my mood at the time being one to curse, that was not intended to
be an expletive “PEP %!& + PEP 518”, but should instead have been just
“PEP 517 + PEP 518”.
:) I did assume an errant shift key
I'm still seeking to know, when ‘PYBUILD_INSTALL_ARGS’ is not specified,
what specific tool knows to do this job, and under what condition?
Old-style packages were using pybuild's distutils plugin that ran
`python3.XY setup.py install --lots-of-args` (and also fed it a config
file) in an effort to get it to copy the files into the staging
directory. Mostly that just worked and no additional options were
needed, but because setup.py allows upstream to anything in code,
sometimes there were special/weird setup.py files that needed additional
options to make them do the right thing. PYBUILD_INSTALL_ARGS was for
those exceptions.
The modern PEP517+friends workflow for pybuild is to use the pyproject
plugin, which does the build by calling `python3.XY -m build` to build a
wheel, and then uses the `installer` module (from python3-installer) to
unpack that wheel into the .pybuild/… staging directory. Going via the
wheel has the nice property for us of isolating build process from the
install process - the build can do whatever it needs to, but we always
get a .whl file and we can then work with that with code that we
entirely control and no setup.py in the way. The `installer` module is
basically just unzipping the wheel (it also makes entry-point scripts).
However, it's not *just* unzipping - it has separately configurable
destinations for modules, data, scripts into the desired file system
schema. Your previous PYBUILD_INSTALL_ARGS was trying to set a schema to
match what Debian needs but that's unneeded here because we're not going
via unmanaged code in setup.py, pybuild calls installer with the correct
schema config directly.
So yes, pybuild's pyproject plugin has no use for --install-args /
PYBUILD_INSTALL_ARGS and just ignores any value for it.
(see pybuild's dhpython/build/plugin_pyproject.py for the gory details)
regards
Stuart
--
Stuart Prescott http://www.nanonanonano.net/ [email protected]
Debian Developer http://www.debian.org/ [email protected]
GPG fingerprint 90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7