Hi, On mié, 2023-11-15 at 13:13 +0000, Adrian Glaubitz via openSUSE Factory wrote:
Hi!
I have updated the python-antlr4-python3-runtime package to the latest upstream version [1]. Unfortunately, the invocation of the testsuite somehow seems to fail with unittest complaining about not knowing the command line parameters provided by the RPM macro:
[ 13s] + python_flavor=python39 [ 13s] + PYTHONPATH=/home/abuild/rpmbuild/BUILDROOT/python-antlr4- python3-runtime-4.13.1-10.1.x86_64/usr/lib/python3.9/site-packages [ 13s] + PYTHONDONTWRITEBYTECODE=1 [ 13s] + python3.9 -m unittest discover -v --pattern '*.py' --start- directory tests [ 13s] usage: python3.9 -m unittest [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [ 13s] [-k TESTNAMEPATTERNS] [ 13s] [tests ...] [ 13s] python3.9 -m unittest: error: unrecognized arguments: --pattern *.py --start-directory tests Does anyone have a suggestion how to fix this before I keep digging for too long?
I think that the macro expansion is okay, I've been testing and it's happening to me running the same command inside the "oscb --shell" abuild@localhost:~/rpmbuild/BUILD/antlr4-4.13.1/runtime/Python3> python3.9 -m unittest discover -v --pattern "*.py" --start-directory tests usage: python3.9 -m unittest [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [-k TESTNAMEPATTERNS] [tests ...] Looks like the pattern "*.py" is catching the "run.py" script inside tests and that tries to run again unittest and that's the fail that you can see. I could recommend to run the tests in this case with: %{python_expand # PYTHONPATH=%{buildroot}%{$python_sitelib} $python tests/run.py } -- Daniel García Moreno Python Packager