https://bugzilla.redhat.com/show_bug.cgi?id=1449882 --- Comment #7 from Charalampos Stratakis <cstratak@xxxxxxxxxx> --- (In reply to Luya Tshimbalanga from comment #6) > (In reply to Ken Dreyer from comment #5) > > (In reply to Luya Tshimbalanga from comment #4) > > > Any suggestion how to properly write %check? Writing the line > > > "%{_python2} setup.py tests/lcms2_testsuite.py" or > > > "%{_python2} tests/lcms2_testsuite.py" failed as a result > > > > Try "export PYTHONPATH=$(pwd)" as the first line under %check. > > Unfortunately, the result is he same > > + export PYTHONPATH=/home/luya/rpmbuild/BUILD/python-lcms2-0.1 > + PYTHONPATH=/home/luya/rpmbuild/BUILD/python-lcms2-0.1 > + py.test-2 tests/lcms2_testsuite.py > ============================= test session starts > ============================== > platform linux2 -- Python 2.7.13, pytest-2.9.2, py-1.4.33, pluggy-0.3.1 > rootdir: /home/luya/rpmbuild/BUILD/python-lcms2-0.1, inifile: > collected 0 items / 1 errors > > ==================================== ERRORS > ==================================== > __________________ ERROR collecting tests/lcms2_testsuite.py > ___________________ > tests/lcms2_testsuite.py:18: in <module> > import lcms2 > E ImportError: No module named lcms2 > =========================== 1 error in 0.03 seconds > ============================ > error: Bad exit status from /var/tmp/rpm-tmp.QmXg4Y (%check) > > Not sure what it will take for python to properly import lcms2 In order to debug this you can add the %clean macro with no arguments after the %install section as it will preserve all the files in the buildroot. Then you can build it with mock, shell inside the chroot and check the structure of the buildroot to figure out where the module is being placed. Now this module imports itself after it has been compiled, to run the tests. However PYTHONPATH doesn't include the directories where the module is being placed inside the buildroot, so in these cases usually you will need to export the paths inside the buildroot (and the path structure mirrors the filesystem). The location of _lcms2.so which should be imported, when looking inside the mock chroot is at: /builddir/build/BUILDROOT/python-lcms2-0.1-2.fc27.x86_64/usr/lib64/python2.7/site-packages/lcms2 So in this case right after %check you will need to add. export PYTHONPATH=%{buildroot}%{python2_sitearch} -- You are receiving this mail because: You are on the CC list for the bug. You are always notified about changes to this product and component _______________________________________________ package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx