diff --git a/astropy-openSUSE-ignore-warnings.patch b/astropy-openSUSE-ignore-warnings.patch new file mode 100644 index 0000000..fb0b9d8 --- /dev/null +++ b/astropy-openSUSE-ignore-warnings.patch @@ -0,0 +1,23 @@ +From: Benjamin Greiner +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 diff --git a/python-astropy.changes b/python-astropy.changes index 2fa29fe..0c6c438 100644 --- a/python-astropy.changes +++ b/python-astropy.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Sun Jul 5 12:24:49 UTC 2020 - Benjamin Greiner + +- Fix conftest collection error: import local source dir for tests +- Remove ignore pytest deprecation fixed by pytest-doctestplus >= 0.6 +- Ignore leap second expiry and dubious year warnings for + reproducible builds: gh#astropy/astropy#10228 + astropy-openSUSE-ignore-warnings.patch + ------------------------------------------------------------------- Wed Jun 3 07:42:45 UTC 2020 - Tomáš Chvátal diff --git a/python-astropy.spec b/python-astropy.spec index e4d3b13..a4a9a6b 100644 --- a/python-astropy.spec +++ b/python-astropy.spec @@ -34,6 +34,7 @@ Summary: Community-developed python astronomy tools License: BSD-3-Clause URL: https://astropy.org 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 # These are used by the python files so they must be available. Source100: python-astropy-rpmlintrc @@ -95,7 +96,7 @@ BuildRequires: %{python_module mpmath} BuildRequires: %{python_module objgraph} BuildRequires: %{python_module pytest >= 3.1} BuildRequires: %{python_module pytest-astropy} -BuildRequires: %{python_module pytest-doctestplus} +BuildRequires: %{python_module pytest-doctestplus >= 0.6} BuildRequires: %{python_module pytest-mpl} # /SECTION %endif @@ -109,6 +110,7 @@ managing them. %prep %setup -q -n astropy-%{version} +%patch0 -p1 # Make sure bundled libs are not used rm -rf cextern/expat @@ -153,17 +155,16 @@ $python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/ %check %if %{with test} -export PYTHONDONTWRITEBYTECODE=1 # http://docs.astropy.org/en/latest/development/testguide.html#running-tests %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 # doctest failure because of precision errors %define skippytest -k 'not bayesian_info_criterion_lsq' %endif -%{pytest_arch -W "ignore:the imp module is deprecated:DeprecationWarning" \ - -W "ignore:Unknown pytest.mark.openfiles_ignore:pytest.PytestUnknownMarkWarning" \ - --ignore "docs/whatsnew" %{?skippytest} -} +%pytest_arch --ignore 'docs/whatsnew' %{?skippytest} %endif %if !%{with test}