Hi josch,

Johannes Schauer Marin Rodrigues, on 2024-09-21:
> when building your package with dpkg-buildpackage -j X, which sets
> DEB_BUILD_OPTIONS=parallel=X, the dh_auto_test step ignores that setting
> and will run with whatever `nproc` returns regardless. Untested patch:
> 
> --- a/debian/rules
> +++ b/debian/rules
> @@ -10,7 +10,13 @@ export PYBUILD_BEFORE_TEST=\
>       && cp -av {dir}/tests/test_data {build_dir}/tests \
>       && cp -av {dir}/tests/data {build_dir}/tests \
>       && cp -av {dir}/pyranges/example_data {build_dir}/pyranges
> -export PYBUILD_TEST_ARGS=-v -n $(shell nproc)
> +
> +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
> +     NUMJOBS = $(patsubst parallel=%,%,$(filter 
> parallel=%,$(DEB_BUILD_OPTIONS)))"
> +else
> +     NUMJOBS = $(shell nproc)
> +endif
> +export PYBUILD_TEST_ARGS=-v -n $(NUMJOBS)
>  
>  %:
>       dh $@ --buildsystem=pybuild

Thanks for the patch, I applied it, modulo the typo at the end
of the "patsubst" line.  Sorry I didn't think of situations
where it is desirable to run builds and tests in a single thread
when hardwiring pytest options some time ago.

Have a nice day,  :)
-- 
  .''`.  Étienne Mollier <emoll...@debian.org>
 : :' :  pgp: 8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
 `. `'   sent from /dev/pts/0, please excuse my verbosity
   `-

Attachment: signature.asc
Description: PGP signature

Reply via email to