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

Name:           python-openslide
Version:        1.4.1
Release:        %autorelease
Summary:        Python bindings for the OpenSlide library

License:        LGPL-2.1-only
URL:            https://openslide.org/
Source0:        https://github.com/openslide/%{upstream_name}/releases/download/v%{version}/%{sdist_name}-%{version}.tar.xz

# Disable Intersphinx so it won't download inventories at build time
Patch0:         openslide-python-1.0.1-disable-intersphinx.patch

BuildRequires:  gcc
BuildRequires:  openslide
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pillow
BuildRequires:  python3-pytest
BuildRequires:  python3-sphinx

%description
The OpenSlide library allows programs to access virtual slide files
regardless of the underlying image format.  This package allows Python
programs to use OpenSlide.


%package -n python3-openslide
Summary:        Python 3 bindings for the OpenSlide library
Requires:       openslide
Requires:       python3-pillow
%{?python_provide:%python_provide python3-openslide}


%description -n python3-openslide
The OpenSlide library allows programs to access virtual slide files
regardless of the underlying image format.  This package allows Python 3
programs to use OpenSlide.


%prep
%autosetup -n %{sdist_name}-%{version} -p1

# Examples include bundled jQuery and OpenSeadragon
rm -rf examples


%build
%py3_build
sphinx-build doc build/html
rm -r build/html/.buildinfo build/html/.doctrees


%install
%py3_install


%check
%if 0%{?rhel} == 9
# pytest 6; no support for pythonpath setting
sed -i -e '/^minversion/ d' pyproject.toml
%pytest --import-mode append
%else
%pytest
%endif


%files -n python3-openslide
%doc CHANGELOG.md build/html
%license COPYING.LESSER
%{python3_sitearch}/openslide/
%{python3_sitearch}/*.egg-info/


%changelog
## START: Generated by rpmautospec
* Wed Oct 30 2024 Benjamin Gilbert <bgilbert@backtick.net> - 1.4.1-1
- Update to 1.4.1

* Tue Oct 29 2024 Benjamin Gilbert <bgilbert@backtick.net> - 1.4.0-1
- Update to 1.4.0

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 1.3.1-7
- Rebuilt for Python 3.13

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

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

* Thu Oct 12 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.1-4
- Disable tests on EPEL 8 because pytest is too old

* Wed Oct 11 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.1-3
- Use correct SPDX license identifier

* Sun Oct 08 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.1-2
- Fix tests on EPEL 9

* Sun Oct 08 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.1-1
- New release
- Drop obsolete versioned dependency on OpenSlide
- Drop obsolete Provides/Obsoletes

* Sat Jul 22 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.0-2
- Fix tests on EPEL 9

* Sat Jul 22 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.3.0-1
- New release

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

* Tue Jul 11 2023 Benjamin Gilbert <bgilbert@backtick.net> - 1.2.0-6
- Avoid invoking setup.py subcommands directly

* Fri Jun 16 2023 Python Maint <python-maint@redhat.com> - 1.2.0-5
- Rebuilt for Python 3.12

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

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

* Sat Jun 18 2022 Python Maint <python-maint@redhat.com> - 1.2.0-2
- Rebuilt for Python 3.11

* Fri Jun 17 2022 Benjamin Gilbert <bgilbert@backtick.net> - 1.2.0-1
- New release

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.1.2-6
- Rebuilt for Python 3.11

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

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

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

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

* Sun Oct 18 2020 Benjamin Gilbert <bgilbert@backtick.net> - 1.1.2-1
- New release

## END: Generated by rpmautospec