Accepting request 910430 from devel:languages:python:numeric

OBS-URL: https://build.opensuse.org/request/show/910430
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-sherpa?expand=0&rev=10
This commit is contained in:
Dominique Leuenberger 2021-08-06 20:44:50 +00:00 committed by Git OBS Bridge
commit f476be3318
3 changed files with 40 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 5 19:36:45 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Add sherpa-pr1227-astropy43.patch in order to fix test failure
gh#sherpa/sherpa#1227
-------------------------------------------------------------------
Fri Jun 11 09:52:54 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -27,6 +27,8 @@ License: GPL-3.0-only
URL: https://github.com/sherpa/sherpa/
Source: https://github.com/sherpa/sherpa/archive/%{version}.tar.gz#/sherpa-%{version}.tar.gz
Patch1: reproducible.patch
# PATCH-FIX-UPSTREAM sherpa-pr1227-astropy43.patch -- gh#sherpa/sherpa#1227
Patch2: https://github.com/sherpa/sherpa/pull/1227.patch#/sherpa-pr1227-astropy43.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel}
BuildRequires: %{python_module setuptools}

View File

@ -0,0 +1,32 @@
From 630574022f538c86265ba01c283b8ebc39ce41a0 Mon Sep 17 00:00:00 2001
From: Douglas Burke <dburke.gw@gmail.com>
Date: Mon, 26 Jul 2021 16:10:25 -0400
Subject: [PATCH] Support AstroPy 4.3 for tests
The FITS checking meant that a test that created a test FITS file
was no-longer valid for AstroPy, so tweak the output to appease
both AstroPy 4.3 and fverify (at least for the header lines, it
still claims the fil character is wrong but this is less important).
---
sherpa/astro/io/tests/test_io.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sherpa/astro/io/tests/test_io.py b/sherpa/astro/io/tests/test_io.py
index daa52d096d..a2bf6fdc93 100644
--- a/sherpa/astro/io/tests/test_io.py
+++ b/sherpa/astro/io/tests/test_io.py
@@ -150,8 +150,12 @@ def fake_rmf(outfile):
def hdr(key, value):
if isinstance(value, str):
value = "'{}'".format(value)
- elif isinstance(value, bool):
- value = 'T' if value else 'F'
+ else:
+ if isinstance(value, bool):
+ value = 'T' if value else 'F'
+
+ # add spacing to make FVERIFY happy
+ value = f"{str(value):>20s}"
out = "{:8s}= {}".format(key, value)
return out.ljust(80)