From 270cebb7b45144be74fa243b68709d344ccde03d Mon Sep 17 00:00:00 2001 From: Christian Dersch Date: Mon, 19 Mar 2018 21:33:05 +0100 Subject: [PATCH] split out python2 parts into python2-astropy, update to astropy 3.0.1 --- .gitignore | 1 + ...ark-all-known-test-failures-as-xfail.patch | 50 ++++++++ python-astropy-system-pytest.patch | 14 --- python-astropy.spec | 119 +++--------------- sources | 2 +- 5 files changed, 69 insertions(+), 117 deletions(-) create mode 100644 python-astropy-Mark-all-known-test-failures-as-xfail.patch delete mode 100644 python-astropy-system-pytest.patch diff --git a/.gitignore b/.gitignore index a349a29..899d3f9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /astropy-2.0.2.tar.gz /astropy-2.0.4.tar.gz /astropy-2.0.5.tar.gz +/astropy-3.0.1.tar.gz diff --git a/python-astropy-Mark-all-known-test-failures-as-xfail.patch b/python-astropy-Mark-all-known-test-failures-as-xfail.patch new file mode 100644 index 0000000..a107f82 --- /dev/null +++ b/python-astropy-Mark-all-known-test-failures-as-xfail.patch @@ -0,0 +1,50 @@ +From: Ole Streicher +Date: Fri, 16 Feb 2018 10:18:22 +0100 +Subject: Mark all known test failures as xfail + +--- + astropy/io/fits/tests/test_convenience.py | 2 ++ + astropy/io/fits/tests/test_core.py | 2 ++ + astropy/io/fits/tests/test_fitstime.py | 3 ++- + 3 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/astropy/io/fits/tests/test_convenience.py b/astropy/io/fits/tests/test_convenience.py +index 50adf1f..a9c941d 100644 +--- a/astropy/io/fits/tests/test_convenience.py ++++ b/astropy/io/fits/tests/test_convenience.py +@@ -140,6 +140,8 @@ class TestConvenience(FitsTestCase): + with pytest.raises(NotImplementedError): + printdiff(in1, in2, 0) + ++ @pytest.mark.xfail(raises=PermissionError, ++ reason="see https://github.com/astropy/astropy/issues/7201") + def test_tabledump(self): + """ + Regression test for https://github.com/astropy/astropy/issues/6937 +diff --git a/astropy/io/fits/tests/test_core.py b/astropy/io/fits/tests/test_core.py +index 205982a..5a7c69f 100644 +--- a/astropy/io/fits/tests/test_core.py ++++ b/astropy/io/fits/tests/test_core.py +@@ -591,6 +591,8 @@ class TestFileFunctions(FitsTestCase): + assert os.path.exists(self.temp('foobar.fits')) + os.remove(self.temp('foobar.fits')) + ++ @pytest.mark.xfail(raises=PermissionError, ++ reason="see https://github.com/astropy/astropy/issues/7201") + def test_open_file_handle(self): + # Make sure we can open a FITS file from an open file handle + with open(self.data('test0.fits'), 'rb') as handle: +diff --git a/astropy/io/fits/tests/test_fitstime.py b/astropy/io/fits/tests/test_fitstime.py +index cc11b81..270a11e 100644 +--- a/astropy/io/fits/tests/test_fitstime.py ++++ b/astropy/io/fits/tests/test_fitstime.py +@@ -301,7 +301,8 @@ class TestFitsTime(FitsTestCase): + assert isinstance(tm['datetime'], Time) + assert tm['datetime'].location.lon.value == 0 + assert tm['datetime'].location.lat.value == 0 +- assert tm['datetime'].location.height.value == 0 ++# see issue https://github.com/astropy/astropy/issues/7198 ++# assert tm['datetime'].location.height.value == 0 + + @pytest.mark.parametrize('table_types', (Table, QTable)) + def test_io_time_read_fits_scale(self, table_types): diff --git a/python-astropy-system-pytest.patch b/python-astropy-system-pytest.patch deleted file mode 100644 index 892bf5d..0000000 --- a/python-astropy-system-pytest.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -ur astropy-1.1.post2/astropy/tests/helper.py astropy-1.1.post2.pytest/astropy/tests/helper.py ---- astropy-1.1.post2/astropy/tests/helper.py 2015-12-11 18:45:19.000000000 +0100 -+++ astropy-1.1.post2.pytest/astropy/tests/helper.py 2016-01-06 19:03:49.280825893 +0100 -@@ -41,8 +41,8 @@ - 'assert_quantity_allclose', 'check_pickling_recovery', - 'pickle_protocol', 'generic_recursive_equality_test'] - -- --if os.environ.get('ASTROPY_USE_SYSTEM_PYTEST') or '_pytest' in sys.modules: -+# Modified by Fedora package -+if True or os.environ.get('ASTROPY_USE_SYSTEM_PYTEST') or '_pytest' in sys.modules: - import pytest - - else: diff --git a/python-astropy.spec b/python-astropy.spec index 170f8d5..99f3a45 100644 --- a/python-astropy.spec +++ b/python-astropy.spec @@ -1,8 +1,3 @@ -# Missing python3 deps in EPEL -%if 0%{?fedora} || 0%{?rhel} >= 8 -%global with_python3 1 -%endif - # Works with system erfa %bcond_without system_erfa @@ -16,7 +11,7 @@ %global srcname astropy Name: python-astropy -Version: 2.0.5 +Version: 3.0.1 Release: 1%{?dist} Summary: A Community Python Library for Astronomy License: BSD @@ -27,6 +22,9 @@ Source1: astropy-README.dist Source2: astropy-ply.py Patch0: python-astropy-system-configobj.patch Patch1: python-astropy-system-six.patch +# Disable known failing tests, taken from Debian +# https://salsa.debian.org/debian-astro-team/astropy/blob/3b20ea052ab8bd0af505380eb4f0c357c901bb3b/debian/patches/Mark-all-known-test-failures-as-xfail.patch +Patch2: python-astropy-Mark-all-known-test-failures-as-xfail.patch BuildRequires: git BuildRequires: cfitsio-devel @@ -51,55 +49,6 @@ particular, we are developing imaging, photometric, and spectroscopic functionality, as well as frameworks for cosmology, unit handling, and coordinate transformations. -%package -n python2-%{srcname} -Summary: A Community Python Library for Astronomy -BuildRequires: python2-devel python-setuptools numpy -# Need 0.14 for scipy.special.factorial -BuildRequires: scipy >= 0.14 -BuildRequires: h5py -BuildRequires: Cython pytest python-six python-ply -BuildRequires: python-sphinx graphviz -BuildRequires: python-matplotlib -BuildRequires: python-configobj -BuildRequires: python2-pandas -BuildRequires: PyYAML - -Requires: numpy -Requires: python-configobj pytest python-six python-ply -# Optionals -Requires: scipy >= 0.14 -Requires: h5py -Requires: PyYAML -Requires: /usr/bin/xmllint - -%{?python_provide:%python_provide python2-%{srcname}} -Provides: bundled(jquery) = 1.11 - -# wcsaxes has been merged into astropy, therefore we obsolete and provide -# the old python-wcsaxes package here -Provides: python2-wcsaxes = %{version}-%{release} -Obsoletes: python2-wcsaxes < 0.9-9 - -%description -n python2-%{srcname} -The Astropy project is a common effort to develop a single core package -for Astronomy. Major packages such as PyFITS, PyWCS, vo, and asciitable -already merged in, and many more components being worked on. In -particular, we are developing imaging, photometric, and spectroscopic -functionality, as well as frameworks for cosmology, unit handling, and -coordinate transformations. - -%package -n python2-%{srcname}-doc -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 python2-%{srcname}-doc} - -%description -n python2-%{srcname}-doc -This package contains the full API documentation for %{name}. - - -%if 0%{?with_python3} %package -n python%{python3_pkgversion}-%{srcname} Summary: A Community Python Library for Astronomy BuildRequires: python%{python3_pkgversion}-devel @@ -107,6 +56,7 @@ BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-pytest-astropy BuildRequires: python%{python3_pkgversion}-six BuildRequires: python%{python3_pkgversion}-ply BuildRequires: python%{python3_pkgversion}-scipy @@ -115,8 +65,6 @@ BuildRequires: python%{python3_pkgversion}-sphinx graphviz BuildRequires: python%{python3_pkgversion}-matplotlib BuildRequires: python%{python3_pkgversion}-configobj BuildRequires: python%{python3_pkgversion}-pandas -# -# BuildRequires: python%{python3_pkgversion}-PyYAML Requires: python%{python3_pkgversion}-numpy @@ -161,7 +109,6 @@ Obsoletes: python%{python3_pkgversion}-wcsaxes-doc < 0.9-9 %description -n python%{python3_pkgversion}-%{srcname}-doc This package contains the full API documentation for %{name}. -%endif # with_python3 %package -n %{srcname}-tools Summary: Astropy utility tools @@ -190,6 +137,8 @@ rm -rf astropy*egg-info %patch1 -p1 # Use system ply cp %{SOURCE2} astropy/extern/ply.py +# Mark known test failures as xfail +%patch2 -p1 # Remove expat, erfa, cfitsio and wcslib rm -rf cextern/cfitsio @@ -215,67 +164,29 @@ echo "use_system_wcslib=1" >> setup.cfg %build %global py_setup_args --offline -%{py2_build} # Use cairo backend due to https://bugzilla.redhat.com/show_bug.cgi?id=1394975 export MPLBACKEND=cairo -%{__python2} setup.py build_sphinx --offline %{?epel:|| :} +%{py3_build} +%{__python3} setup.py build_sphinx --offline rm -f docs/_build/html/.buildinfo -%if 0%{?with_python3} -%{py3_build} -#%{__python3} setup.py build_sphinx --offline -#rm -f docs/_build/html/.buildinfo -mkdir -p docs/_build3/ -%endif # with_python3 - %install -%if 0%{?fedora} - -%{py2_install} - -%if 0%{?with_python3} %{py3_install} -%endif # with_python3 - -%else - -%if 0%{?with_python3} -%{py3_install} -%endif # with_python3 - -%{py2_install} - -%endif # fedora - find %{buildroot} -name "*.so" | xargs chmod 755 %check +# Tests on s390x tend to stuck (already for scipy used by astropy) %ifnarch s390x -pushd %{buildroot}/%{python2_sitearch} -py.test-%{python2_version} -k "not (test_write_read_roundtrip or test_web_profile or TestStandardProfileHTTPSHub or TestStandardProfileHTTPSHubClient or TestStandardProfile or test_mask_array)" astropy -popd - -%if 0%{?with_python3} pushd %{buildroot}/%{python3_sitearch} -py.test-%{python3_version} -k "not (test_write_read_roundtrip or test_web_profile or TestStandardProfileHTTPSHub or TestStandardProfileHTTPSHubClient or TestStandardProfile or test_mask_array)" astropy +py.test-%{python3_version} -k "not test_write_read_roundtrip" astropy popd -%endif # with_python3 %endif # ifnarch s390x -%files -n python2-%{srcname} -%doc README.rst README.dist -%license LICENSE.rst -%{python2_sitearch}/* %files -n %{srcname}-tools %{_bindir}/* -%files -n python2-%{srcname}-doc -%doc README.rst README.dist docs/_build/html -%license LICENSE.rst - -%if 0%{?with_python3} %files -n python%{python3_pkgversion}-%{srcname} %doc README.rst README.dist %license LICENSE.rst @@ -285,9 +196,13 @@ popd %doc README.rst README.dist docs/_build/html %license LICENSE.rst -%endif # with_python3 - %changelog +* Sat Mar 17 2018 Christian Dersch - 3.0.1-1 +- new version +- cleaned up excluded tests, adapted patch from Debian for known failures +- removed Python 2 bits (in new package python2-astropy), astropy moved to + Python 3 only + * Wed Mar 14 2018 Christian Dersch - 2.0.5-1 - new version - enabled fixed tests diff --git a/sources b/sources index 988c517..0fbb1b0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (astropy-2.0.5.tar.gz) = 1e19c9870d2fab6ed58f0809d49c471c9acd5bb12543b0387cae418020812792bcb28143f77ea586c4bc40f266fc23bcb4b371f666fd2fa6bf59ec7f05cb50db +SHA512 (astropy-3.0.1.tar.gz) = f947fe941e9fada8e5b085cbc0e27257a0944d5cf18456504d2f8829de596534e2346cf9263167a0ee8c610ac9ccedd051e1b5640068ad83e1c9fd64e31c55b4