From 259b5b811d4b3c1317b2ffd2c16434c7e6ed62ab Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Jun 15 2022 14:41:11 +0000 Subject: Allow bootstrapping with new Python versions, add a tests bcond --- diff --git a/python-pyerfa.spec b/python-pyerfa.spec index ceab947..a80c68e 100644 --- a/python-pyerfa.spec +++ b/python-pyerfa.spec @@ -1,5 +1,7 @@ %global module_name erfa %global pypi_name pyerfa +# tests need pytest-astropy, needs astropy, needs pyerfa +%bcond_without tests Name: python-pyerfa Version: 2.0.0.1 @@ -11,10 +13,13 @@ Source0: %{pypi_source} # Python BuildRequires BuildRequires: python3-devel -BuildRequires: %{py3_dist jinja2} -BuildRequires: %{py3_dist pytest_astropy} BuildRequires: %{py3_dist setuptools} BuildRequires: %{py3_dist setuptools_scm} +BuildRequires: %{py3_dist numpy} +%if %{with tests} +BuildRequires: %{py3_dist jinja2} +BuildRequires: %{py3_dist pytest_astropy} +%endif # Non-Python BuildRequires BuildRequires: erfa-devel BuildRequires: gcc @@ -53,11 +58,15 @@ PYERFA_USE_SYSTEM_LIBERFA=1 %py3_build %check +%if %{with tests} pushd %{buildroot}%{python3_sitearch}/%{module_name} %{__python3} -m pytest rm -rf .pytest_cache rm tests/__pycache__/test_erfa*pytest*.pyc popd +%else +%py3_check_import %{module_name} +%endif %files -n python3-%{pypi_name}