Replacing pytest -n auto with pytest -n %{_smp_build_ncpus}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Pythonistats, packagers,

A handful of Fedora Python packages uses pytest-xdist to run tests in parallel like this:

  %pytest -n auto

-n auto means pytest will spawn a number of workers processes equal to the number of available CPUs.

In the spirit of other packaging guidelines, I believe we should use this instead:

  %pytest -n %{_smp_build_ncpus}

This means the same thing in most of the ceases, but will limit the number of workers depending on other constraints in the spec or in the environment.

Should I do this in a mass change? Not so many packages use pytest -n auto in the spec:

  $ rg -l -- '(-n|--numprocesses)(\s*|=)auto(\s|$)'
  ansible-bender.spec
  azure-cli.spec
  ocrmypdf.spec
  python-cartopy.spec
  python-GridDataFormats.spec
  python-hypothesis.spec
  python-matplotlib.spec
  python-mplcairo.spec
  python-rpmautospec.spec
  python-sqlalchemy.spec
  python-tox.spec
  python-xarray.spec
  python-zstandard.spec
  pythran.spec
  scipy.spec

(Other packages have that in tox.ini or pytest config file, but I am not aiming at changing that here.)

And, considering many other packages might want to benefit from that, should this be:

 1) encouraged in the Python packaging guidelines
 2) macronized (I was thinking %pytest_parallel, but TBD)

?

--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux