2019-12-09 19:49:08 +01:00
|
|
|
|
#
|
|
|
|
|
# spec file for package python-sherpa
|
|
|
|
|
#
|
2024-01-03 20:46:16 +01:00
|
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2019-12-09 19:49:08 +01:00
|
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name: python-sherpa
|
2023-12-15 04:58:15 +01:00
|
|
|
|
Version: 4.16.0
|
2019-12-09 19:49:08 +01:00
|
|
|
|
Release: 0
|
|
|
|
|
Summary: Modeling and fitting package for scientific data analysis
|
|
|
|
|
License: GPL-3.0-only
|
|
|
|
|
URL: https://github.com/sherpa/sherpa/
|
2022-06-13 10:29:00 +02:00
|
|
|
|
Source0: https://github.com/sherpa/sherpa/archive/%{version}.tar.gz#/sherpa-%{version}.tar.gz
|
2023-01-20 23:42:00 +01:00
|
|
|
|
Source1: https://github.com/sherpa/sherpa-test-data/archive/refs/tags/%{version}.tar.gz#/sherpa-test-data-%{version}.tar.gz
|
|
|
|
|
BuildRequires: %{python_module devel >= 3.8}
|
2022-02-06 08:07:42 +01:00
|
|
|
|
BuildRequires: %{python_module numpy-devel >= 1.19}
|
2022-08-15 09:21:58 +02:00
|
|
|
|
BuildRequires: %{python_module pip}
|
|
|
|
|
BuildRequires: %{python_module wheel}
|
2019-12-09 19:49:08 +01:00
|
|
|
|
BuildRequires: bison
|
|
|
|
|
BuildRequires: fdupes
|
2021-04-24 22:33:16 +02:00
|
|
|
|
BuildRequires: fftw3-devel
|
2019-12-09 19:49:08 +01:00
|
|
|
|
BuildRequires: flex
|
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2022-02-06 08:07:42 +01:00
|
|
|
|
Requires: python-numpy >= 1.19
|
2020-05-19 14:14:25 +02:00
|
|
|
|
Requires(post): update-alternatives
|
2021-04-24 22:33:16 +02:00
|
|
|
|
Requires(postun):update-alternatives
|
2022-02-06 08:07:42 +01:00
|
|
|
|
ExcludeArch: %{ix86} %{arm}
|
2019-12-09 19:49:08 +01:00
|
|
|
|
# SECTION test requirements
|
2023-01-20 23:42:00 +01:00
|
|
|
|
BuildRequires: %{python_module pytest >= 5}
|
2024-01-03 22:26:31 +01:00
|
|
|
|
# doctestplus tests don’t look ready gh#sherpa/sherpa#1719
|
|
|
|
|
# BuildRequires: %{python_module pytest-doctestplus}
|
2023-05-29 16:13:39 +02:00
|
|
|
|
BuildRequires: %{python_module pytest-xdist}
|
2019-12-09 19:49:08 +01:00
|
|
|
|
BuildRequires: %{python_module pytest-xvfb}
|
2022-06-13 10:29:00 +02:00
|
|
|
|
# Highly recommended by upstream when building from source
|
2021-04-24 22:33:16 +02:00
|
|
|
|
BuildRequires: %{python_module astropy}
|
|
|
|
|
BuildRequires: %{python_module matplotlib}
|
2019-12-09 19:49:08 +01:00
|
|
|
|
# /SECTION
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Sherpa is the CIAO modeling and fitting application. It enables the
|
|
|
|
|
user to construct models from definitions and fit those models to
|
|
|
|
|
data, using a variety of statistics and optimization methods.
|
|
|
|
|
|
|
|
|
|
%prep
|
2023-09-08 19:10:57 +02:00
|
|
|
|
%autosetup -p1 -n sherpa-%{version} -a1
|
2022-08-15 09:21:58 +02:00
|
|
|
|
# uncomment system libs https://sherpa.readthedocs.io/en/latest/install.html#fftw
|
2021-04-24 22:33:16 +02:00
|
|
|
|
sed -i "s|#fftw=local|fftw=local|" setup.cfg
|
|
|
|
|
sed -i "s|#fftw-include[-_]dirs.*$|fftw-include-dirs=%{_includedir}|" setup.cfg
|
|
|
|
|
sed -i "s|#fftw-lib-dirs.*$|fftw-lib-dirs=%{_libdir}|" setup.cfg
|
|
|
|
|
sed -i "s|#fftw-libraries|fftw-libraries|" setup.cfg
|
2023-01-20 23:42:00 +01:00
|
|
|
|
rm -r extern/fftw-*
|
|
|
|
|
# adjust the "install path" for stk.so and group.so for the build phase
|
|
|
|
|
sed -i "/pydir =/ s/libdir,/self.install_dir, '%{_lib}',/" helpers/sherpa_config.py
|
2019-12-09 19:49:08 +01:00
|
|
|
|
|
|
|
|
|
%build
|
2021-04-24 22:33:16 +02:00
|
|
|
|
cp -r extern extern0
|
2022-08-15 09:21:58 +02:00
|
|
|
|
%{python_expand #
|
|
|
|
|
# use the python3X bundled setuptools instead of setuptools 60+ from the distribution
|
|
|
|
|
# https://sherpa.readthedocs.io/en/latest/install.html#building-from-source
|
|
|
|
|
mkdir -p build
|
|
|
|
|
$python -m venv build/buildenv --system-site-packages
|
|
|
|
|
build/buildenv/bin/pip wheel --no-deps --disable-pip-version-check --use-pep517 --no-build-isolation --progress-bar off --verbose . -w build/
|
2021-04-24 22:33:16 +02:00
|
|
|
|
rm -r extern
|
|
|
|
|
cp -r extern0 extern
|
2019-12-09 19:49:08 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%install
|
2022-08-15 09:21:58 +02:00
|
|
|
|
%pyproject_install
|
2021-04-24 22:33:16 +02:00
|
|
|
|
|
2020-05-19 14:14:25 +02:00
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/sherpa_test
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/sherpa_smoke
|
2019-12-09 19:49:08 +01:00
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
|
|
|
|
|
2021-04-24 22:33:16 +02:00
|
|
|
|
%{python_expand # REMOVE HASHBANGS FROM NON-EXEC FILES
|
|
|
|
|
sed -i "1{/\\/usr\\/bin\\/env python/d}" %{buildroot}%{$python_sitearch}/sherpa/optmethods/ncoresde.py
|
2020-03-12 16:40:02 +01:00
|
|
|
|
sed -i "1{/\\/usr\\/bin\\/env python/d}" %{buildroot}%{$python_sitearch}/sherpa/optmethods/ncoresnm.py
|
|
|
|
|
sed -i "1{/\\/usr\\/bin\\/env python/d}" %{buildroot}%{$python_sitearch}/sherpa/optmethods/opt.py
|
2021-04-24 22:33:16 +02:00
|
|
|
|
sed -i "1{/\\/usr\\/bin\\/env python/d}" %{buildroot}%{$python_sitearch}/sherpa/utils/akima.py
|
2020-03-12 16:40:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
2019-12-09 19:49:08 +01:00
|
|
|
|
%check
|
2021-04-24 22:33:16 +02:00
|
|
|
|
# avoid conftest import mismatch
|
2019-12-09 19:49:08 +01:00
|
|
|
|
mv sherpa sherpa_temp
|
2023-01-20 23:42:00 +01:00
|
|
|
|
export PYTHONPATH=$PWD/sherpa-test-data-%{version}
|
2022-06-13 10:29:00 +02:00
|
|
|
|
# unclosed resource warnings by pytest although the tests use Path.to_text which should have closed it.
|
|
|
|
|
donttest="test_save"
|
2022-02-06 08:07:42 +01:00
|
|
|
|
# precision issues
|
|
|
|
|
%ifnarch x86_64
|
|
|
|
|
donttest+=" or (test_regproj and sherpa.plot.dummy_backend)"
|
|
|
|
|
donttest+=" or (test_fit_single and Chi2XspecVar)"
|
|
|
|
|
%endif
|
2023-12-15 04:58:15 +01:00
|
|
|
|
donttest+=" or test_Griewank"
|
2023-05-29 16:13:39 +02:00
|
|
|
|
%pytest_arch %{?jobs:-n %jobs} --pyargs sherpa -k "not ($donttest)"
|
2019-12-09 19:49:08 +01:00
|
|
|
|
|
2020-05-19 14:14:25 +02:00
|
|
|
|
%post
|
|
|
|
|
%python_install_alternative sherpa_smoke
|
|
|
|
|
%python_install_alternative sherpa_test
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%python_uninstall_alternative sherpa_smoke
|
|
|
|
|
%python_uninstall_alternative sherpa_test
|
|
|
|
|
|
2019-12-09 19:49:08 +01:00
|
|
|
|
%files %{python_files}
|
|
|
|
|
%doc README.md
|
|
|
|
|
%license LICENSE
|
2020-05-19 14:14:25 +02:00
|
|
|
|
%python_alternative %{_bindir}/sherpa_test
|
|
|
|
|
%python_alternative %{_bindir}/sherpa_smoke
|
2021-04-24 22:33:16 +02:00
|
|
|
|
%{python_sitearch}/sherpa
|
2023-12-15 04:58:15 +01:00
|
|
|
|
%{python_sitearch}/sherpa-%{version}.dist-info
|
2021-04-24 22:33:16 +02:00
|
|
|
|
%{python_sitearch}/stk.so
|
|
|
|
|
%{python_sitearch}/group.so
|
2019-12-09 19:49:08 +01:00
|
|
|
|
|
|
|
|
|
%changelog
|