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

Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)



[Éric Araujo, 2014-03-15]
> Hi,
> 
> >>   I tried the first solution and did not see a difference in tests:
> >>both times, 223 tests were run successfully.  I’d like to reproduce
> >>the errors you mention to be sure that any change I make is actually
> >>a fix.
> >
> >I guess this is the solution since if the C modules are not found the
> >test is just skipped (and does not fail).
> 
> I expected to see fewer tests run when the C modules are found.  I was not
> able to find one example test that runs if a C module is found and skipped
> if not.
> 
> >If you could provide this very patch I'd be really glad.
> 
> Run “python build_ext --inplace build test” for tests, “python install” to
> copy all files to the debian/tmp/etc directory.  This will avoid the other
> bug I mention (http://bugs.python.org/issue5977#msg213606).
> 
> I did not use the debian/rules makefile, but modifying line 45 to add
> “build_ext --inplace build” before “test” should do the trick.
> 
> (Putting the option in a setup.cfg file as I initially advised would cause
> the error I alluded to when running “setup.py install”.)

pybuild takes care of "distutils cannot find files it build in previous
step and has to build them again" problem. I just checked
python-biopython and all .so files are in the right location
(yey pybuild! :).

The problem is package's root directory has higher priority on sys.path
and your package has both Bio and BioSQL it there (instead of in src or lib
directory, like other upstreams do... you know... "Python standards")

anyway, that's one of the reasons I do this in pybuild:

  cd BUILD_DIRECTORY; run_tests

this way files from you package's root directory are not taken into account.

To fix your problem apply this change (not tested, because clean target
is not doing the right thing and I'm too lazy to fix it):

-	dh_auto_test -- --test --system=custom --test-args='env DIALIGN2_DIR=/usr/share/dialign EMBOSS_ROOT=/usr/lib/emboss PYTHONPATH={build_dir} {interpreter} setup.py test'
+	dh_auto_test -- --test --system=custom --test-args='env DIALIGN2_DIR=/usr/share/dialign EMBOSS_ROOT=/usr/lib/emboss; cd {build_dir}; {interpreter} setup.py test'

-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

Attachment: signature.asc
Description: Digital signature


Reply to: