Accepting request 819886 from devel:languages:python:numeric

OBS-URL: https://build.opensuse.org/request/show/819886
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-astropy?expand=0&rev=12
This commit is contained in:
Dominique Leuenberger 2020-07-10 12:13:29 +00:00 committed by Git OBS Bridge
commit 6baf93ab4e
3 changed files with 20 additions and 51 deletions

View File

@ -1,23 +0,0 @@
From: Benjamin Greiner <code@bnavigator.de>
Date: 2020-07-05 13:43:14 +0200
Subject: ignore test warnings for reproducible builds
References: gh#astropy/astropy#10228
Upstream: discussed on github, but openSUSE specific
Ignore leap-second and dubious year warnings for reproducible builds.
Patching setup.cfg instead of -W option for python/pytest call
because regular expressions do not work for the latter.
--- astropy-4.0.1.post1.orig/setup.cfg 2020-04-02 03:18:04.000000000 +0200
+++ astropy-4.0.1.post1/setup.cfg 2020-07-05 13:43:14.132689750 +0200
@@ -120,6 +120,9 @@
ignore:PY_SSIZE_T_CLEAN will be required for '#' formats
ignore:::astropy.tests.plugins.display
ignore:::astropy.tests.disable_internet
+ ignore:the imp module is deprecated:DeprecationWarning
+ ignore:leap-second file is expired:astropy.utils.iers.iers.IERSStaleWarning
+ ignore:ERFA function.*dubious year:astropy.utils.exceptions.ErfaWarning
[bdist_wininst]
bitmap = static/wininst_background.bmp

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Jul 9 23:14:09 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
- Switch from pytest macro back to astropy.test()
This avoids compiling a second time inplace and obsoletes the
necessary deprecation warningsfilters. New deprecation warnings
from numpy 1.19 started to fail the test multibuild again.
Can now drop astropy-openSUSE-ignore-warnings.patch
- Fix update-alternatives warnings by expanding the loop early
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Jul 5 12:24:49 UTC 2020 - Benjamin Greiner <code@bnavigator.de> Sun Jul 5 12:24:49 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@ -34,7 +34,6 @@ Summary: Community-developed python astronomy tools
License: BSD-3-Clause License: BSD-3-Clause
URL: https://astropy.org URL: https://astropy.org
Source: https://files.pythonhosted.org/packages/source/a/astropy/astropy-%{version}.tar.gz Source: https://files.pythonhosted.org/packages/source/a/astropy/astropy-%{version}.tar.gz
Patch0: astropy-openSUSE-ignore-warnings.patch
# Mark wcs headers as false positives for devel-file-in-non-devel-package # Mark wcs headers as false positives for devel-file-in-non-devel-package
# These are used by the python files so they must be available. # These are used by the python files so they must be available.
Source100: python-astropy-rpmlintrc Source100: python-astropy-rpmlintrc
@ -81,6 +80,7 @@ BuildRequires: %{python_module Bottleneck}
BuildRequires: %{python_module Jinja2} BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module asdf >= 2.5} BuildRequires: %{python_module asdf >= 2.5}
BuildRequires: %{python_module astropy}
BuildRequires: %{python_module beautifulsoup4} BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module bleach} BuildRequires: %{python_module bleach}
BuildRequires: %{python_module h5py} BuildRequires: %{python_module h5py}
@ -108,9 +108,9 @@ common tools needed for performing astronomy and astrophysics research with
Python. It also provides an index for other astronomy packages and tools for Python. It also provides an index for other astronomy packages and tools for
managing them. managing them.
%if !%{with test}
%prep %prep
%setup -q -n astropy-%{version} %setup -q -n astropy-%{version}
%patch0 -p1
# Make sure bundled libs are not used # Make sure bundled libs are not used
rm -rf cextern/expat rm -rf cextern/expat
@ -122,12 +122,9 @@ echo "[build]" >> setup.cfg
echo "use_system_libraries=1" >> setup.cfg echo "use_system_libraries=1" >> setup.cfg
%build %build
%if !%{with test}
%python_build --use-system-libraries --offline %python_build --use-system-libraries --offline
%endif
%install %install
%if !%{with test}
%python_install --use-system-libraries --offline %python_install --use-system-libraries --offline
for b in %{binaries}; do for b in %{binaries}; do
%python_clone -a %{buildroot}%{_bindir}/$b %python_clone -a %{buildroot}%{_bindir}/$b
@ -153,43 +150,28 @@ $python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/
} }
%endif %endif
%check
%if %{with test} %if %{with test}
# http://docs.astropy.org/en/latest/development/testguide.html#running-tests %check
%python_exec setup.py build_ext --inplace --offline
# import from local source dir for proper conftest.py collection
# and using above inplace built extensions
export PYTHONPATH=$(pwd)
%ifarch aarch64 %ifarch aarch64
# doctest failure because of precision errors # doctest failure because of precision errors
%define skippytest -k 'not bayesian_info_criterion_lsq' %define skip_pytest -k 'not bayesian_info_criterion_lsq'
%endif %endif
%pytest_arch --ignore 'docs/whatsnew' %{?skippytest} # http://docs.astropy.org/en/latest/development/testguide.html#running-tests
# running pytest directly would require building the extensions inplace
%python_exec -B -c "import astropy; astropy.test(args=\"-v %{?skip_pytest}\")"
%endif %endif
%if !%{with test} %if !%{with test}
%post %post
for b in %{binaries}; do %{expand:%(for b in %{binaries}; do echo "%%python_install_alternative $b"; done)}
%python_install_alternative $b
done
%postun %postun
for b in %{binaries}; do %{expand:%(for b in %{binaries}; do echo "%%python_uninstall_alternative $b"; done)}
%python_uninstall_alternative $b
done
%files %{python_files} %files %{python_files}
%doc CHANGES.rst README.rst %doc CHANGES.rst README.rst
%license licenses/* %license licenses/*
%python_alternative %{_bindir}/fitsdiff %{expand:%(for b in %{binaries}; do echo "%%python_alternative %%{_bindir}/$b"; done)}
%python_alternative %{_bindir}/fitsheader
%python_alternative %{_bindir}/fitscheck
%python_alternative %{_bindir}/fitsinfo
%python_alternative %{_bindir}/fits2bitmap
%python_alternative %{_bindir}/samp_hub
%python_alternative %{_bindir}/showtable
%python_alternative %{_bindir}/volint
%python_alternative %{_bindir}/wcslint
%{python_sitearch}/astropy/ %{python_sitearch}/astropy/
%{python_sitearch}/astropy-%{version}-py*.egg-info %{python_sitearch}/astropy-%{version}-py*.egg-info
%endif %endif