[Debian-med-packaging] How to switch python-pysam package from nosetest to pytest

Andreas Tille andreas at an3as.eu
Tue Sep 19 19:42:47 UTC 2017


On Mon, Sep 18, 2017 at 11:18:43PM +0200, Mattia Rizzolo wrote:
> On Mon, Sep 18, 2017 at 10:54:40PM +0200, Andreas Tille wrote:
> > in a Github issue[1] upstream told suggested to move from nosetest
> > to pytest for python-pysam[2] package.  Any hint how to approach
> > this?
> 
> You are asking for it in d/rules:
>     export PYBUILD_TEST_NOSE=1
> (plus some related lines after).
> 
> I think you should try and see whether pybuild's autodetection works
> fine, as it usually does.

Seems I'm not lucky here.  I tried the following patch:


diff --git a/debian/changelog b/debian/changelog
index 9d290ad..cbeba9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ python-pysam (0.12.0.1+ds-1) UNRELEASED; urgency=medium
   * Standards-Version: 4.1.0 (no changes needed)
   * Apply upstream patch to fix test suite
     Closes: #871083, #834856
+  * Do not use nosetest
 
   [ Afif Elghraoui ]
   * New upstream version
diff --git a/debian/rules b/debian/rules
index d062880..39aeb3f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,17 +15,6 @@ HTSLIBDIR  := /usr/lib/$(DEB_HOST_MULTIARCH)
 export HTSLIB_LIBRARY_DIR=$(HTSLIBDIR)
 export HTSLIB_INCLUDE_DIR=/usr/include
 
-export PYBUILD_TEST_NOSE=1
-# pybuild calls nosetests as `python{version} -m nose tests`
-#
-# The "tests" argument (passed by pybuild as shown above) fails,
-# so don't pass anything:
-export PYBUILD_TEST_ARGS=
-# This is how we pass parameters to nose without command-line flags
-export NOSE_WHERE=$(CURDIR)/tests
-export NOSE_VERBOSE=2
-export NOSE_NOCAPTURE=1
-
 # DEB_BUILD_OPTIONS := nocheck
 
 clean: clean-tests


simply droping all references to nose.

Unfortunately it seems nose seems to be used anyway:

...
dh_auto_test
I: pybuild base:184: cd /build/python-pysam-0.12.0.1+ds/.pybuild/pythonX.Y_2.7/build; python2.7 -m nose tests
...............................................................................................................................................................................................
[E::hts_open_format] Failed to open file exdoesntexist.sam
[E::hts_open_format] Failed to open file exdoesntexist.bam
[E::hts_open_format] Failed to open file exdoesntexist.sam
...


Even worse the now removed variables make the tests fail badly.

Any hint how to realy force pytest instead of relying on autodetection?

BTW, I'm also fine with nosetest.  I simply was hoping for better
error output for the Segmentation fault issue[1].

Kind regards

       Andreas.

[1] https://github.com/pysam-developers/pysam/issues/542

-- 
http://fam-tille.de



More information about the Debian-med-packaging mailing list