Fix wrong provides of python3-astropy in python2-astropy (bz #1380135)

* Fix falling test (https://github.com/astropy/astropy/pull/5203)
This commit is contained in:
Sergio Pascual 2016-09-30 15:30:41 +02:00
parent c76fdc18b5
commit ceaee1fac1
2 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,26 @@
From 886bcb218e71ae95a63947ee95c0dc1bb0946750 Mon Sep 17 00:00:00 2001
From: Ze Vinicius <jvmirca@gmail.com>
Date: Thu, 28 Jul 2016 06:42:11 -0300
Subject: [PATCH] fixes test circmean against scipy
---
astropy/stats/tests/test_circstats.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/astropy/stats/tests/test_circstats.py b/astropy/stats/tests/test_circstats.py
index c1c3c06..b30b074 100644
--- a/astropy/stats/tests/test_circstats.py
+++ b/astropy/stats/tests/test_circstats.py
@@ -40,8 +40,10 @@ def test_circmean():
@pytest.mark.skipif('not HAS_SCIPY')
def test_circmean_against_scipy():
# testing against scipy.stats.circmean function
- data = np.random.uniform(-np.pi, np.pi, size=(100, 5))
- answer = scipy.stats.circmean(data, np.pi, -np.pi)
+ # the data is the same as the test before, but in radians
+ data = np.array([0.89011792, 1.1693706, 0.6981317, 1.90240888, 0.54105207,
+ 6.24827872])
+ answer = scipy.stats.circmean(data)
assert_equal(np.around(answer, 2), np.around(circmean(data), 2))

View File

@ -8,7 +8,7 @@
Name: python-astropy
Version: 1.2.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A Community Python Library for Astronomy
License: BSD
@ -19,6 +19,9 @@ Source2: astropy-ply.py
Patch0: python-astropy-system-configobj.patch
Patch1: python-astropy-system-pytest.patch
Patch2: python-astropy-system-six.patch
# Fix problem with test 'test_circmean_against_scipy'
# https://github.com/astropy/astropy/pull/5203
Patch3: https://github.com/astropy/astropy/commit/2b363d2b1fb4c897fecedda563fb396d7c1bc6ec.patch
BuildRequires: python2-devel
%if 0%{?with_python3}
@ -108,7 +111,7 @@ Requires: python%{python3_pkgversion}-h5py
Requires: python%{python3_pkgversion}-PyYAML
Requires: /usr/bin/xmllint
%{?python_provide:%python_provide python2-%{srcname}}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
Provides: bundled(jquery) = 1.11
%description -n python%{python3_pkgversion}-%{srcname}
@ -124,7 +127,7 @@ Summary: Documentation for %{name}, includes full API docs
# Disabled for the moment to avoid name collision
# of generated names between arches
# BuildArch: noarch
%{?python_provide:%python_provide python3-%{srcname}-doc}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}-doc}
%description -n python%{python3_pkgversion}-%{srcname}-doc
This package contains the full API documentation for %{name}.
@ -160,6 +163,7 @@ rm -rf astropy*egg-info
%patch2 -p1
# Use system ply
cp %{SOURCE2} astropy/extern/ply.py
%patch3 -p1
# Remove expat, erfa, cfitsio and wcslib
rm -rf cextern/expat
@ -242,6 +246,9 @@ popd
%endif # with_python3
%changelog
* Fri Sep 30 2016 Sergio Pascual <sergiopr@fedoraproject.org> - 1.2.1-3
- Fix wrong provides of python3-astropy in python2-astropy (bz #1380135)
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages