Blob Blame History Raw
%bcond_without tests

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

Name:           python-chaospy
Version:        4.3.5
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: make
BuildRequires: pyproject-rpm-macros
BuildRequires: %{py3_dist lockfile}
BuildRequires: %{py3_dist pep517}
BuildRequires: %{py3_dist poetry}
# This particular version is required for the tests
# https://github.com/jonathf/chaospy/issues/307#issuecomment-735379840
BuildRequires: %{py3_dist numpoly} >= 1.1

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

Requires: %{py3_dist networkx}
Requires: %{py3_dist scikit-learn}
Requires: %{py3_dist lockfile}
Requires: %{py3_dist pep517}

%description -n python3-chaospy
%{desc}

%prep
%autosetup -n chaospy-%{version}
%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
%autochangelog