rpmlint icon indicating copy to clipboard operation
rpmlint copied to clipboard

Warn against python setup.py test construct

Open mcepl opened this issue 2 years ago • 6 comments

https://github.com/pypa/setuptools/issues/1684

python setup.py test subcommand has been deprecated, users should be warned against using it.

mcepl avatar Jul 20 '21 11:07 mcepl

I see. So should we warn about any %python_exec setup.py test call in a spec file? Are you willing to create a pull request for it? Looking at openSUSE:Factory package, there are quite some:

grep 'setup.py test' *.spec | wc -l
162

marxin avatar Jul 22 '21 12:07 marxin

Yes, and when I have time eventually (and I would love somebody beat me to it).

Yes, I am aware, but I hope that exactly rpmlint warning could be helpful in identifying and eliminating the crap.

mcepl avatar Jul 22 '21 12:07 mcepl

What benefit do we have to do this without providing a useful alternative to users? One thing I don't want to have is more warnings/errors that people can't do anything about, and this is one that would generally fall in that class.

Conan-Kudo avatar Jul 22 '21 12:07 Conan-Kudo

Users? rpmlint is not for users but for packagers, who can very well do something about it.

mcepl avatar Jul 22 '21 12:07 mcepl

If they don't know how to fix the Python code for running tests, they may not be able to.

Conan-Kudo avatar Jul 22 '21 12:07 Conan-Kudo

This is just absurd! 90% of all cases is just replacing the construct with %pytest or %pyunittest discover -v. Python maintainers who cannot maintain Python packages are hopefully an exception not the rule which we need to accommodate.

mcepl avatar Jul 22 '21 13:07 mcepl