Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-sherpa for openSUSE:Factory 
checked in at 2021-02-17 18:12:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-sherpa (Old)
 and      /work/SRC/openSUSE:Factory/.python-sherpa.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-sherpa"

Wed Feb 17 18:12:34 2021 rev:7 rq:873034 version:4.13.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-sherpa/python-sherpa.changes      
2020-10-15 13:51:33.637328488 +0200
+++ /work/SRC/openSUSE:Factory/.python-sherpa.new.28504/python-sherpa.changes   
2021-02-17 18:13:27.222034540 +0100
@@ -1,0 +2,10 @@
+Wed Feb 17 00:07:40 UTC 2021 - Atri Bhattacharya <badshah...@gmail.com>
+
+- Update to version 4.13.0:
+  * A few minor documentation updates.
+  * Version number update to coincide with CIAO version 4.13.0.
+- Add sherpa-numpy-1.20.patch: Fix test errors with numpy 1.20
+  [gh#sherpa/sherpa#/1092]; patch committed upstream.
+- Disable python 3.6 flavour: dependency numpy not supported.
+
+-------------------------------------------------------------------

Old:
----
  sherpa-4.12.1.tar.gz

New:
----
  sherpa-4.13.0.tar.gz
  sherpa-numpy-1.20.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-sherpa.spec ++++++
--- /var/tmp/diff_new_pack.aZPaJC/_old  2021-02-17 18:13:28.110035267 +0100
+++ /var/tmp/diff_new_pack.aZPaJC/_new  2021-02-17 18:13:28.114035270 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-sherpa
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,8 +18,9 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         skip_python2 1
+%define         skip_python36 1
 Name:           python-sherpa
-Version:        4.12.1
+Version:        4.13.0
 Release:        0
 Summary:        Modeling and fitting package for scientific data analysis
 License:        GPL-3.0-only
@@ -28,6 +29,8 @@
 Patch1:         reproducible.patch
 # PATCH-FIX-UPSTREAM - https://github.com/sherpa/sherpa/issues/970
 Patch2:         sherpa-fix-aarch64.patch
+# PATCH-FIX-UPSTREAM sherpa-numpy-1.20.patch badshah...@gmail.com - Fix test 
errors with numpy 1.20 [https://github.com/sherpa/sherpa/pull/1092]
+Patch3:         sherpa-numpy-1.20.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module numpy-devel}
 BuildRequires:  %{python_module setuptools}

++++++ sherpa-4.12.1.tar.gz -> sherpa-4.13.0.tar.gz ++++++
/work/SRC/openSUSE:Factory/python-sherpa/sherpa-4.12.1.tar.gz 
/work/SRC/openSUSE:Factory/.python-sherpa.new.28504/sherpa-4.13.0.tar.gz 
differ: char 12, line 1

++++++ sherpa-numpy-1.20.patch ++++++
>From 1ca81268c560b712677f91c98c5481ef473bfa0e Mon Sep 17 00:00:00 2001
From: Douglas Burke <dburke...@gmail.com>
Date: Sun, 31 Jan 2021 19:03:24 -0500
Subject: [PATCH 1/3] Whitelist np.bool/int/float warning from NumPy 1.20 in
 tests

As well as white-listing the warnings I've had to tweak one set
of tests which was explicitly checking the warning messages
(and so needed to ignore the known warnings).
---
 .../astro/tests/test_astro_data_swift_unit.py | 21 ++++++----
 sherpa/conftest.py                            | 38 +++++++++++++++----
 2 files changed, 43 insertions(+), 16 deletions(-)

Index: sherpa-4.13.0/sherpa/astro/tests/test_astro_data_swift_unit.py
===================================================================
--- sherpa-4.13.0.orig/sherpa/astro/tests/test_astro_data_swift_unit.py
+++ sherpa-4.13.0/sherpa/astro/tests/test_astro_data_swift_unit.py
@@ -172,7 +172,12 @@ def test_read_pha_fails_rmf(make_data_pa
     assert emsg in str(excinfo.value)
 
 
-def validate_replacement_warning(ws, rtype, label):
+def validate_replacement_warning(ws, rtype, label, is_known_warning):
+    """Check that there is one expected warning."""
+
+    # Filter out the "allowed" warnings.
+    #
+    ws = [w for w in ws if not is_known_warning(w)]
 
     assert len(ws) == 1
     w = ws[0]
@@ -185,7 +190,7 @@ def validate_replacement_warning(ws, rty
 
 @requires_data
 @requires_fits
-def test_read_arf(make_data_path):
+def test_read_arf(make_data_path, is_known_warning):
     """Can we read in a Swift ARF."""
 
     infile = make_data_path(ARFFILE)
@@ -194,7 +199,7 @@ def test_read_arf(make_data_path):
         warnings.simplefilter("always")
         arf = io.read_arf(infile)
 
-    validate_replacement_warning(ws, 'ARF', infile)
+    validate_replacement_warning(ws, 'ARF', infile, is_known_warning)
 
     assert isinstance(arf, DataARF)
 
@@ -262,7 +267,7 @@ def test_read_arf_fails_rmf(make_data_pa
 
 @requires_data
 @requires_fits
-def test_read_rmf(make_data_path):
+def test_read_rmf(make_data_path, is_known_warning):
     """Can we read in a Swift RMF."""
 
     infile = make_data_path(RMFFILE)
@@ -271,7 +276,7 @@ def test_read_rmf(make_data_path):
         warnings.simplefilter("always")
         rmf = io.read_rmf(infile)
 
-    validate_replacement_warning(ws, 'RMF', infile)
+    validate_replacement_warning(ws, 'RMF', infile, is_known_warning)
 
     assert isinstance(rmf, DataRMF)
 
@@ -362,7 +367,7 @@ def test_read_rmf_fails_arf(make_data_pa
 
 @requires_data
 @requires_fits
-def test_can_use_swift_data(make_data_path):
+def test_can_use_swift_data(make_data_path, is_known_warning):
     """A basic check that we can read in and use the Swift data.
 
     Unlike the previous tests, that directly access the io module,
@@ -383,14 +388,14 @@ def test_can_use_swift_data(make_data_pa
         warnings.simplefilter("always")
         ui.load_rmf(rmffile)
 
-    validate_replacement_warning(ws, 'RMF', rmffile)
+    validate_replacement_warning(ws, 'RMF', rmffile, is_known_warning)
 
     arffile = make_data_path(ARFFILE)
     with warnings.catch_warnings(record=True) as ws:
         warnings.simplefilter("always")
         ui.load_arf(arffile)
 
-    validate_replacement_warning(ws, 'ARF', arffile)
+    validate_replacement_warning(ws, 'ARF', arffile, is_known_warning)
 
     assert ui.get_analysis() == 'energy'
 
Index: sherpa-4.13.0/sherpa/conftest.py
===================================================================
--- sherpa-4.13.0.orig/sherpa/conftest.py
+++ sherpa-4.13.0/sherpa/conftest.py
@@ -116,7 +116,12 @@ known_warnings = {
             # Matplotlib version 2 warnings (from HTML notebook represention)
             #
             r'np.asscalar\(a\) is deprecated since NumPy v1.16, use a.item\(\) 
instead',
-            r"Using or importing the ABCs from 'collections' instead of from 
'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop 
working"
+            r"Using or importing the ABCs from 'collections' instead of from 
'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop 
working",
+
+            # numpy 1.20 bool/float issue
+            r'`np.bool` is a deprecated alias for the builtin `bool`. .*',
+            r'`np.int` is a deprecated alias for the builtin `int`. .*',
+            r'`np.float` is a deprecated alias for the builtin `float`. .*',
         ],
     UserWarning:
         [
@@ -140,18 +145,11 @@ known_warnings = {
          # See https://github.com/ContinuumIO/anaconda-issues/issues/6678
          r"numpy.dtype size changed, may indicate binary " +
          r"incompatibility. Expected 96, got 88",
-         # I am getting the following from astropy with at least python 2.7 
during the conda tests
-         r"numpy.ufunc size changed, may indicate binary ",
+         # See https://github.com/numpy/numpy/pull/432
+         r"numpy.ufunc size changed",
+         # numpy 1.20 shows this in some tests
+         r"numpy.ndarray size changed, may indicate binary "
          ],
-     VisibleDeprecationWarning:
-        [],
-}
-
-# Since Sherpa now requires Python 3.5 at a minumum, the following
-# are always added, but kept as a separate dict and then merged
-# to make it clearer where they came from.
-#
-python3_warnings = {
     ResourceWarning:
         [
             r"unclosed file .*king_kernel.txt.* closefd=True>",
@@ -166,17 +164,9 @@ python3_warnings = {
             r"unclosed file .*/dev/null.* closefd=True>",
             r"unclosed file .*table.txt.* closefd=True>",
         ],
-    RuntimeWarning:
-        [r"invalid value encountered in sqrt",
-         # See https://github.com/ContinuumIO/anaconda-issues/issues/6678
-         r"numpy.dtype size changed, may indicate binary " +
-         r"incompatibility. Expected 96, got 88",
-         # See https://github.com/numpy/numpy/pull/432
-         r"numpy.ufunc size changed"
-         ],
+    VisibleDeprecationWarning:
+        [],
 }
-known_warnings.update(python3_warnings)
-
 
 if have_astropy:
     astropy_warnings = {
@@ -230,13 +220,8 @@ def capture_all_warnings(request, recwar
     pytestconfig injected service for accessing the configuration data
 
     """
-    def known(warning):
-        message = warning.message
-        for known_warning in known_warnings[type(message)]:
-            pattern = re.compile(known_warning)
-            if pattern.match(str(message)):
-                return True
-        return False
+
+    known = check_known_warning
 
     def fin():
         warnings = [w for w in recwarn.list
@@ -263,6 +248,28 @@ def capture_all_warnings(request, recwar
     request.addfinalizer(fin)
 
 
+def check_known_warning(warning):
+    """Return True if this is an "allowed" warning."""
+
+    message = warning.message
+    for known_warning in known_warnings[type(message)]:
+        pattern = re.compile(known_warning)
+        if pattern.match(str(message)):
+            return True
+
+    return False
+
+
+@pytest.fixture
+def is_known_warning():
+    """Returns a function that returns True if this is an "allowed" warning.
+
+    It is not expected that this will see much use.
+    """
+
+    return check_known_warning
+
+
 def pytest_configure(config):
     """
     This configuration hook overrides the default mechanism for test data 
self-discovery, if the --test-data command line

Reply via email to