[med-svn] [Git][med-team/nipy][master] Try to resolve nipy autopkgtest failure due to numpy testing decorators by...

Andreas Tille gitlab at salsa.debian.org
Fri May 29 11:41:45 BST 2020



Andreas Tille pushed to branch master at Debian Med / nipy


Commits:
1f9fd22a by Andreas Tille at 2020-05-29T12:41:11+02:00
Try to resolve nipy autopkgtest failure due to numpy testing decorators by applying PR 458 but there are remaining issues

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/458.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+nipy (0.4.2-4) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Resolve nipy autopkgtest failure due to numpy testing decorators
+    Closes: #959138
+
+ -- Andreas Tille <tille at debian.org>  Fri, 29 May 2020 11:41:36 +0200
+
 nipy (0.4.2-3) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/458.patch
=====================================
@@ -0,0 +1,176 @@
+From f66617c5702b29e144404c42267aae9342370215 Mon Sep 17 00:00:00 2001
+From: Matteo Visconti di Oleggio Castello <mvdoc at berkeley.edu>
+Date: Sat, 25 Apr 2020 17:47:37 -0700
+Subject: [PATCH 1/8] FIX import of decorators for newer versions of numpy
+Origin: https://patch-diff.githubusercontent.com/raw/nipy/nipy/pull/458.patch
+        --> Adapted to other Debian patches
+Bug-Debian: https://bugs.debian.org/959138
+
+---
+ nipy/algorithms/clustering/tests/test_vmm.py     | 6 +++++-
+ nipy/algorithms/diagnostics/tests/test_screen.py | 8 +++++++-
+ nipy/testing/__init__.py                         | 7 +++++++
+ nipy/tests/test_scripts.py                       | 8 +++++++-
+ 4 files changed, 26 insertions(+), 3 deletions(-)
+
+--- a/nipy/algorithms/clustering/tests/test_vmm.py
++++ b/nipy/algorithms/clustering/tests/test_vmm.py
+@@ -13,7 +13,11 @@ from ..von_mises_fisher_mixture import (
+                                         select_vmm_cv)
+ 
+ from nose.tools import assert_true, assert_equal
+-from numpy.testing import decorators
++try:
++    from numpy.testing import decorators
++except ImportError:
++    from numpy.testing import dec
++    decorators = dec
+ 
+ from nibabel.optpkg import optional_package
+ 
+--- a/nipy/algorithms/diagnostics/tests/test_screen.py
++++ b/nipy/algorithms/diagnostics/tests/test_screen.py
+@@ -23,7 +23,13 @@ from nibabel.tmpdirs import InTemporaryD
+ from nose.tools import (assert_true, assert_false, assert_equal, assert_raises)
+ 
+ from numpy.testing import (assert_array_equal, assert_array_almost_equal,
+-                           assert_almost_equal, decorators)
++                           assert_almost_equal)
++
++try:
++    from numpy.testing import decorators
++except ImportError:
++    from numpy.testing import dec
++    decorators = dec
+ 
+ from nipy.testing import funcfile
+ from nipy.testing.decorators import needs_mpl_agg
+--- a/nipy/testing/__init__.py
++++ b/nipy/testing/__init__.py
+@@ -36,6 +36,13 @@ funcfile = os.path.join(basedir, 'functi
+ anatfile = os.path.join(basedir, 'anatomical.nii.gz')
+ 
+ from numpy.testing import *
++# Re import decorators/dec depending on numpy's version
++try:
++    from numpy.testing import decorators
++except ImportError:
++    from numpy.testing import dec
++    decorators = dec
++
+ # Overwrites numpy.testing.Tester
+ from .nosetester import NipyNoseTester as Tester
+ test = Tester().test
+--- a/nipy/tests/test_scripts.py
++++ b/nipy/tests/test_scripts.py
+@@ -19,7 +19,13 @@ from nipy.core.api import rollimg
+ from nose.tools import assert_true, assert_false, assert_equal, assert_raises
+ 
+ from ..testing import funcfile
+-from numpy.testing import decorators, assert_almost_equal
++from numpy.testing import assert_almost_equal
++
++try:
++    from numpy.testing import decorators
++except ImportError:
++    from numpy.testing import dec
++    decorators = dec
+ 
+ from nipy.testing.decorators import make_label_dec
+ 
+--- a/nipy/testing/decorators.py
++++ b/nipy/testing/decorators.py
+@@ -8,7 +8,10 @@ dependency on nose.
+ from __future__ import print_function
+ from __future__ import absolute_import
+ 
+-from numpy.testing.decorators import *
++try:
++    from numpy.testing.decorators import *
++except ImportError:
++    from numpy.testing._private.decorators import *
+ 
+ from nipy.utils import templates, example_data, DataError
+ 
+--- a/nipy/algorithms/statistics/rft.py
++++ b/nipy/algorithms/statistics/rft.py
+@@ -20,7 +20,11 @@ import numpy as np
+ from numpy.linalg import pinv
+ 
+ from scipy import stats
+-from scipy.special import gamma, gammaln, beta, hermitenorm, factorial
++try:
++    from scipy.misc import factorial
++except ImportError:
++    from scipy.special import factorial
++from scipy.special import gamma, gammaln, beta, hermitenorm
+ 
+ # Legacy repr printing from numpy.
+ from nipy.testing import legacy_printing as setup_module  # noqa
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -94,7 +94,9 @@ before_install:
+     - if [ -n "$PRE_DEPENDS" ]; then
+       pip install $EXTRA_PIP_FLAGS $PRE_DEPENDS;
+       fi
+-    - pip install $EXTRA_PIP_FLAGS $DEPENDS
++    - if [ -n "$DEPENDS" ]; then
++      pip install $EXTRA_PIP_FLAGS $DEPENDS;
++      fi
+     - if [ "${COVERAGE}" == "1" ]; then
+       pip install coverage;
+       pip install coveralls codecov;
+--- a/doc-requirements.txt
++++ b/doc-requirements.txt
+@@ -1,7 +1,7 @@
+ # Requirements for building docs
+ # Check these dependencies against doc/conf.py
+ -r dev-requirements.txt
+-sphinx>=1.0
++sphinx>=1.0,<3.0
+ numpydoc
+ matplotlib
+ texext
+--- a/nipy/algorithms/statistics/formula/formulae.py
++++ b/nipy/algorithms/statistics/formula/formulae.py
+@@ -267,10 +267,10 @@ class FactorTerm(Term):
+             return sympy.Symbol.__mul__(self, other)
+ 
+ 
+-class Beta(sympy.symbol.Dummy):
++class Beta(sympy.Dummy):
+     ''' A symbol tied to a Term `term` '''
+     def __new__(cls, name, term):
+-        new = sympy.symbol.Dummy.__new__(cls, name)
++        new = sympy.Dummy.__new__(cls, name)
+         new._term = term
+         return new
+ 
+--- a/nipy/algorithms/statistics/tests/test_rft.py
++++ b/nipy/algorithms/statistics/tests/test_rft.py
+@@ -6,6 +6,10 @@ import numpy as np
+ 
+ from scipy.special import gammaln, hermitenorm, factorial
+ import scipy.stats
++try:
++    from scipy.misc import factorial
++except ImportError:
++    from scipy.special import factorial
+ 
+ from .. import rft
+ 
+--- a/nipy/labs/group/permutation_test.py
++++ b/nipy/labs/group/permutation_test.py
+@@ -6,8 +6,10 @@ from __future__ import print_function, a
+ 
+ # Third-party imports
+ import numpy as np
+-import scipy.misc as sm
+-from scipy.special import comb
++try:
++    from scipy.misc import comb
++except ImportError:
++    from scipy.special import comb
+ import warnings
+ 
+ # Our own imports


=====================================
debian/patches/series
=====================================
@@ -6,3 +6,4 @@ deb_no_ipython_console_highlight
 changeset_aafe079d3bc2928c159cf2ecaa9fbdb3f6520e02.diff
 changeset_9f435191a420bf416ded3c32123fb2aa1163256a.diff
 python3
+458.patch



View it on GitLab: https://salsa.debian.org/med-team/nipy/-/commit/1f9fd22a3dec265716dedd5f92382d094f1100f8

-- 
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/commit/1f9fd22a3dec265716dedd5f92382d094f1100f8
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200529/20c678dd/attachment-0001.html>


More information about the debian-med-commit mailing list