## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%bcond_without tests

%global desc %{expand: \
Chaospy is a numerical tool for performing uncertainty quantification using
polynomial.}

Name:           python-chaospy
Version:        4.3.8
Release:        %autorelease
Summary:        Numerical tool for performing uncertainty quantification using polynomial
License:        MIT
URL:            https://github.com/jonathf/chaospy
Source0:        %{url}/archive/%{version}/chaospy-%{version}.tar.gz
BuildArch:      noarch
# python-chaospy FTBFS on 32-bit architectures
# https://bugzilla.redhat.com/show_bug.cgi?id=2022855
ExcludeArch:    %{ix86} %{arm32}

%description
%{desc}

%package -n python3-chaospy
Summary:        %{summary}

BuildRequires: python3-devel

%if %{with tests}
BuildRequires:  %{py3_dist scikit-learn}
BuildRequires:  %{py3_dist pytest}
%endif

%description -n python3-chaospy
%{desc}

%prep
%autosetup -n chaospy-%{version}

# This particular version is required for the tests
# https://github.com/jonathf/chaospy/issues/307#issuecomment-735379840
sed -i 's/numpoly.*/numpoly>=1.1/' requirements.txt

%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_buildrequires -r

%build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel

%install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_install
%pyproject_save_files chaospy

%check
%if %{with tests}
export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib}
%{pytest} tests
%endif

%files -n python3-chaospy -f %{pyproject_files}
%doc README.rst

%changelog
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> 4.3.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Tue Sep 27 2022 Iztok Fister Jr <iztok@iztok-jr-fister.eu> 4.3.8-1
- Update to latest release

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> 4.3.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jul 04 2022 Python Maint <python-maint@redhat.com> 4.3.7-2
- Rebuilt for Python 3.11

* Fri May 06 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> 4.3.7-1
- feat: update to 4.3.7 (fixes rhbz#2053801)

* Mon May 02 2022 Benjamin A. Beasley <code@musicinmybrain.net> 4.3.5-2
- Exclude 32-bit architectures (close RHBZ#2022855)

* Thu Feb 10 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> 4.3.5-1
- feat: update to 4.3.5 (fixes rhbz#2023599)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Aug 18 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 4.3.3-1
- Update to latest release

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 4.2.4-2
- Rebuilt for Python 3.10

* Wed Apr 07 2021 Luis Bazan <lbazan@fedoraproject.org> - 4.2.4-1
- New upstream version

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Sun Nov 29 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 4.2.1-2
- Enable all tests

* Sat Nov 28 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 4.2.1-1
- Update to latest release

* Wed Aug 12 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.3.8-1
- New usptream version

* Sat Aug 08 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.3.6-1
- New usptream version

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jul 03 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 3.3.3-1
- Update to latest upstream
- Fix FTI
- Re-enable tests

* Fri Jun 26 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.3.2-1
- New usptream version

* Thu Jun 04 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.2.12-1
- New usptream version

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.2.11-3
- Rebuilt for Python 3.9

* Fri May 22 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.2.11-2
- Rebuild

* Wed May 13 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.2.11-1
- New upstream version

* Tue Apr 21 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.2.10-1
- New upstream version

* Fri Feb 28 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.2.4-1
- New upstream version

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Jan 10 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.1.1-2
- Fix Bogus date changelog

* Fri Jan 10 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.1.1-1
- New upstream version

* Wed Jan 08 2020 Luis Bazan <lbazan@fedoraproject.org> - 3.1.0-1
- New upstream version

* Mon Dec 23 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.17-1
- New upstream version

* Thu Nov 14 2019 Aniket Pradhan <major@fedoraproject.org> - 3.0.16-1
- Update to v3.0.16

* Sun Oct 27 2019 Ankur Sinha <ankursinha@fedoraproject.org> - 3.0.14-2
- Enable tests

* Fri Oct 25 2019 Ankur Sinha <ankursinha@fedoraproject.org> - 3.0.14-1
- Update to 3.0.14
- Build now uses poetry, so we use new python macros
- https://src.fedoraproject.org/rpms/pyproject-rpm-macros/tree/master

* Tue Sep 24 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.11-3
- Rebuild

* Sat Aug 31 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.11-2
- disable test

* Sat Aug 31 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.11-1
- New upstream version

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.7-2
- Rebuilt for Python 3.8

* Mon Aug 19 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.7-1
- New upstream version

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.6-2
- Rebuilt for Python 3.8

* Thu Aug 01 2019 Ankur Sinha <ankursinha@fedoraproject.org> - 3.0.6-1
- Update to new version

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Jun 28 2019 Luis M. Segundo <blackfile@fedoraproject.org> - 3.0.5-1
- New upstream version

* Mon Apr 08 2019 Luis Bazan <lbazan@fedoraproject.org> - 3.0.3-1
- New upstream version

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Nov 29 2018 Luis Bazan <lbazan@fedoraproject.org> - 2.3.5-2
- permissions fixed

* Tue Nov 27 2018 Luis Bazan <lbazan@fedoraproject.org> - 2.3.5-1
- New upstream
- change license to MIT

* Mon Nov 26 2018 Luis Bazan <lbazan@fedoraproject.org> - 2.3.4-1
- New upstream
- Fix test thanks (Ankur)