Article View: linux.debian.maint.python
Article #23Re: AutoPkgTest to run Doctest on installed Python modules
From: Ben Finney
Date: Wed, 14 Oct 2026 06:50
Date: Wed, 14 Oct 2026 06:50
65 lines
5184 bytes
5184 bytes
Stuart Prescott <stuart@debian.org> writes: > Telling autopkgtest to run the tests against the module as installed > is enough; the following works both at build time and at autopkgtest > time: > > export PYBUILD_TEST_ARGS = --pyargs jaraco.logging Thanks; that is a command-line option for PyTest that instructs it to import modules and find test cases on them. Okay, that allows removing entirely the custom test suite for AutoPkgTest, and allowing it to run just PyTest as specified. > - PYBUILD_AFTER_TEST is unnecessary now that you don't have the manual > d/*install step, so you can lose a few lines from d/rules. Done, thank you. Is this because PyBuild (or something else?) does the cleanup of PyTest temporary cruft? > - PYBUILD_SYSTEM is unneeded because that is explicitly what the build > dependency on pybuild-plugin-pyproject asks for already. The ‘dh’ option ‘--buildsystem pybuild’ also specifies this. Is that what instructs PyBuild correctly? Or is that option also superfluous? > - 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? > - --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? > - oldoldstable also satisfies the version constraint for > python3-pytest, so unless you are particularly keen on porting to > some ancient LTS (that won't have a new enough python3 for this > package anyway), you can skip that too. Done, thank you. (I had attempted to specify the complex dependency from upstream, “pytest >= 6, != 8.1.*”. But it was too much trouble translating that to Debian dependency relationships, and anyway no Debian release has any of the problematic PyTest versions.) > Obviously none of these things are important…, but deleting things now > might save a future someone wondering why they were added or prevent > them propagating into other packages via copy+paste. It also inches us > towards declarative packaging by having much less in d/rules. I'm definitely in favour of this. I just wish the facts of Python packaging in Debian were better kept up to date, maybe in the wiki, and not reliant on stumbling to error and knowledge locked away in people's minds. There's a lot of outdated advice written out there. -- \ “Never do anything against conscience even if the state demands | `\ it.” —Albert Einstein | _o__) | Ben Finney
Technical Details
Message-ID:
<NO0Yi-5pGG-3@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.corradoroberto.it!diesel.cu.mi.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>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!newsfeed.bofh.team!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod From: Ben Finney <bignose@debian.org> Newsgroups: linux.debian.maint.python Subject: Re: AutoPkgTest to run Doctest on installed Python modules Date: Wed, 14 Oct 2026 08:50:02 +0200 Message-ID: <NO0Yi-5pGG-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> X-Mailbox-Line: From debian-python-request@lists.debian.org Wed Oct 14 06:49:13 2026 Old-Return-Path: <debian-python@m.gmane-mx.org> X-Amavis-Spam-Status: No, score=-1.651 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249] autolearn=no autolearn_force=no X-Policyd-Weight: using cached result; rate: -4.6 X-Injected-Via-Gmane: http://gmane.org/ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:KPF+qAXjFic+QHlGHvTdi4kYLuY= X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney <bignose+hates-spam@benfinney.id.au> X-Mailing-List: <debian-python@lists.debian.org> archive/latest/24127 List-ID: <debian-python.lists.debian.org> List-URL: <https://lists.debian.org/debian-python/> List-Archive: https://lists.debian.org/msgid-search/87mrsgsrox.fsf@benfinney.id.au Approved: robomod@news.nic.it Lines: 65 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Wed, 14 Oct 2026 17:48:46 +1100 X-Original-Message-ID: <87mrsgsrox.fsf@benfinney.id.au> X-Original-References: <875wz7u4rc.fsf@benfinney.id.au> <20261012065551.32714c0e@debian.org> <87wlrmrl8d.fsf_-_@benfinney.id.au> <a36d9d53-8c27-41b4-85ae-07e77f39c36d@debian.org>