Article View: linux.debian.maint.python
Article #25Re: AutoPkgTest to run Doctest on installed Python modules
From: Stuart Prescott
Date: Thu, 15 Oct 2026 01:30
Date: Thu, 15 Oct 2026 01:30
81 lines
9004 bytes
9004 bytes
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/ stuart@nanonanonano.net Debian Developer http://www.debian.org/ stuart@debian.org GPG fingerprint 90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7
Technical Details
Message-ID:
<NOis9-5zwu-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomodReferences:
<NNcoN-4YEM-1@gated-at.bofh.it> <NNiaR-51N7-7@gated-at.bofh.it> <NNHiV-5f4K-1@gated-at.bofh.it> <NO02d-5pdh-1@gated-at.bofh.it> <NO0Yi-5pGG-3@gated-at.bofh.it> <NOgA1-5yoA-3@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.corradoroberto.it!news.servidellagleba.it!bofh.it!news.nic.it!robomod From: Stuart Prescott <stuart@debian.org> Newsgroups: linux.debian.maint.python Subject: Re: AutoPkgTest to run Doctest on installed Python modules Date: Thu, 15 Oct 2026 03:30:01 +0200 Message-ID: <NOis9-5zwu-3@gated-at.bofh.it> References: <NNcoN-4YEM-1@gated-at.bofh.it> <NNiaR-51N7-7@gated-at.bofh.it> <NNHiV-5f4K-1@gated-at.bofh.it> <NO02d-5pdh-1@gated-at.bofh.it> <NO0Yi-5pGG-3@gated-at.bofh.it> <NOgA1-5yoA-3@gated-at.bofh.it> X-Mailbox-Line: From debian-python-request@lists.debian.org Thu Oct 15 01:23:28 2026 Old-Return-Path: <stuart@debian.org> X-Amavis-Spam-Status: No, score=-4.641 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB Autocrypt: addr=stuart@debian.org; keydata= xsFNBFB3ScwBEACzJ9ehyV3mYYBk+LKkJC4Bnz20a9PGs1hs5pYGWxx8dy59VVUkAnGyHVrX fs0o0E4WdXZDx8mHVKWvRdBN8izuDX/rB11ItPckVJAINLt8r+iHnb3EzcXXQnWdW7VWVvR4 AdL2fSF0sq0RXdG48XyHF+LqIAvohIcywe/379mblhFjYxv9YVJSANotP4J+w5voRSuyB53v JLzJlkuyZLiJu3BE36zFRq+zMJ28t+F+PjtdtK2/f3XQVAlQ1DFJkOgKtm7n9QESponJz3y6 t3/wWjAtSjEGCLtAho78ySZy/Q3VwxWRA9eZwlw9OHXM5itHYF584NIZptixp//9DgEgUdEP vPiFbY1UKSNvahx78PfNPqAQBL5c/SDbiBrz7/pa4ygr4BvKjjgTr4DLQuTO9NVuTVlF+cwK g3JxWbRTDUOLle3vG410vhaiyb2SizL6PBybVbnnlu9Fuivr5Da0Zdjs8nBj15hzXrSVuq0J TfXoHuQMJ4NM6vDxo1n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/O6O+6o o8m3Iweb7vzDaEOTPDqMK++GuRRC2RurKGEHkX9sWNvBadOHALoUP2XJTkRQ2lBgXu0yvEEJ QpeuO3/pTdt86SGVGQ/fCcbmdk9ZgC0GixtTP/lbhBtdj+62ym2VdcOGAQESuNPoFtbNLHTP 4Ohh8Q4vj3oz8pSSr2Dx5wqh5uvLxH6F7Dn4WI9+H7s7blqwZsrWBYrz5NQLAteeDqyeCkX/ rNAdrJokPzdpa8SzpmOz7lqGR0U5FBdjobMd+e2twXWY2+VdWPRCcVH/IrLNenvS9w== Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Debian-User: stuart X-Mailing-List: <debian-python@lists.debian.org> archive/latest/24129 List-ID: <debian-python.lists.debian.org> List-URL: <https://lists.debian.org/debian-python/> List-Archive: https://lists.debian.org/msgid-search/adb9a3ac-ad79-4713-bbb8-fc0ac7499555@debian.org Approved: robomod@news.nic.it Lines: 81 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Thu, 15 Oct 2026 12:23:05 +1100 X-Original-Message-ID: <adb9a3ac-ad79-4713-bbb8-fc0ac7499555@debian.org> X-Original-References: <875wz7u4rc.fsf@benfinney.id.au> <20261012065551.32714c0e@debian.org> <87wlrmrl8d.fsf_-_@benfinney.id.au> <a36d9d53-8c27-41b4-85ae-07e77f39c36d@debian.org> <87mrsgsrox.fsf@benfinney.id.au> <87ik33sw3w.fsf@benfinney.id.au>