## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 10;
    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

%global pypi_name xbout

Name:           python-%{pypi_name}
Version:        0.3.5
Release:        %autorelease
Summary:        Collects BOUT++ data from parallelized simulations into xarray

License:        ASL 2.0
URL:            https://github.com/boutproject/xBOUT
Source0:        %{pypi_source}
BuildArch:      noarch

Patch:          https://github.com/boutproject/xBOUT/pull/278.patch
Patch:          https://github.com/boutproject/xBOUT/pull/283.patch
Patch:          https://github.com/boutproject/xBOUT/pull/291.patch
Patch:          xarray-version.patch

# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}

BuildRequires:  python3-devel
# Sphinx for docs
BuildRequires:  python3dist(sphinx)
BuildRequires:  python3-boutdata
# Testing
BuildRequires:  python3dist(pytest)

%generate_buildrequires
%pyproject_buildrequires -r

%description
xBOUT provides an interface for collecting the output data from a
BOUT++ simulation into an xarray dataset in an efficient and
scalable way, as well as accessor methods for common BOUT++ analysis
and plotting tasks.


%package -n     python3-%{pypi_name}
Summary:        %{summary}
%py_provides python3-%{pypi_name}}

Requires:  python3-boutdata

%description -n python3-%{pypi_name}
xBOUT provides an interface for collecting the output data from a
BOUT++ simulation into an xarray dataset in an efficient and
scalable way, as well as accessor methods for common BOUT++ analysis
and plotting tasks.

%package -n python3-%{pypi_name}-doc
Summary:        xBOUT documentation
Recommends:     python3-%{pypi_name}
%description -n python3-%{pypi_name}-doc
Documentation for xBOUT

%prep
%autosetup -n %{pypi_name}-%{version} -p 1
# Remove bundled egg-info
rm -rf xbout.egg-info

%build
%py3_build
# generate html docs 
PYTHONPATH=${PWD} sphinx-build-3 docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
%py3_install

%check
%pytest xbout --long


%files -n python3-%{pypi_name}
%license LICENSE
%doc README.md
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/xbout-%{version}-py?.*.egg-info

%files -n python3-%{pypi_name}-doc
%doc html
%license LICENSE

%changelog
## START: Generated by rpmautospec
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.5-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Tue Jul 25 2023 David Bold <dave@ipp.mpg.de> - 0.3.5-8
- Animatplot has been updated

* Mon Jul 24 2023 David Bold <davidsch@fedoraproject.org> - 0.3.5-7
- fix whitespace in patch

* Mon Jul 24 2023 David Bold <dave@ipp.mpg.de> - 0.3.5-6
- Switch to animatplot-ng

* Sun Jul 23 2023 Python Maint <python-maint@redhat.com> - 0.3.5-5
- Rebuilt for Python 3.12

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Mar 27 2023 David Bold <davidsch@fedoraproject.org> - 0.3.5-3
- Fix whitespace in patch

* Fri Mar 24 2023 David Bold <davidsch@fedoraproject.org> - 0.3.5-2
- Remove restriction on xarray version

* Thu Mar 23 2023 David Bold <davidsch@fedoraproject.org> - 0.3.5-1
- Update to 0.3.5

* Sun Jan 22 2023 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.4-3
- Drop support for i686

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

* Mon Jan 09 2023 David Bold <davidsch@fedoraproject.org> - 0.3.4-1
- Update to 0.3.4

* Thu Aug 25 2022 David Bold <davidsch@fedoraproject.org> - 0.3.3-1
- Update to 0.3.3

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

* Tue Jun 21 2022 David Bold <davidsch@fedoraproject.org> - 0.3.1-3
- Rebuild for python3.11

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

* Thu Sep 23 2021 David Bold <davidsch@fedoraproject.org> - 0.3.1-1
- Update to 0.3.1

* Sun Aug 22 2021 David Bold <davidsch@fedoraproject.org> - 0.2.5-1
- Update to 0.2.5

* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.4-3
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

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

* Sat Apr 17 2021 David Schwörer <davidsch@fedoraproject.org> - 0.2.4-1
- Update to 0.2.4

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

* Sun Dec 06 2020 David Schwörer <davidsch@fedoraproject.org> - 0.2.3-0.2
- Fix FTI
- Fix License

* Sun Dec 06 2020 David Schwörer <davidsch@fedoraproject.org> - 0.2.3-0.1
- Initial package.

## END: Generated by rpmautospec