d78caf7
%global upstream_name openslide-python
d78caf7
d78caf7
Name:           python-openslide
a6f73db
Version:        1.3.1
e3624db
Release:        %autorelease
d78caf7
Summary:        Python bindings for the OpenSlide library
d78caf7
bf9aad4
License:        LGPL-2.1-only
a6f73db
URL:            https://openslide.org/
d78caf7
Source0:        https://github.com/openslide/%{upstream_name}/releases/download/v%{version}/%{upstream_name}-%{version}.tar.xz
d78caf7
d78caf7
# Disable Intersphinx so it won't download inventories at build time
d78caf7
Patch0:         openslide-python-1.0.1-disable-intersphinx.patch
d78caf7
d78caf7
BuildRequires:  gcc
a6f73db
BuildRequires:  openslide
d78caf7
BuildRequires:  python3-devel
d78caf7
BuildRequires:  python3-setuptools
d78caf7
BuildRequires:  python3-pillow
2e2f8f3
BuildRequires:  python3-pytest
d78caf7
BuildRequires:  python3-sphinx
d78caf7
d78caf7
%description
d78caf7
The OpenSlide library allows programs to access virtual slide files
d78caf7
regardless of the underlying image format.  This package allows Python
d78caf7
programs to use OpenSlide.
d78caf7
d78caf7
d78caf7
%package -n python3-openslide
d78caf7
Summary:        Python 3 bindings for the OpenSlide library
a6f73db
Requires:       openslide
d78caf7
Requires:       python3-pillow
d78caf7
%{?python_provide:%python_provide python3-openslide}
d78caf7
d78caf7
d78caf7
%description -n python3-openslide
d78caf7
The OpenSlide library allows programs to access virtual slide files
d78caf7
regardless of the underlying image format.  This package allows Python 3
d78caf7
programs to use OpenSlide.
d78caf7
d78caf7
d78caf7
%prep
d78caf7
%autosetup -n %{upstream_name}-%{version} -p1
d78caf7
d78caf7
# Examples include bundled jQuery and OpenSeadragon
d78caf7
rm -rf examples
d78caf7
d78caf7
d78caf7
%build
d78caf7
%py3_build
2e2f8f3
sphinx-build doc build/html
2e2f8f3
rm -r build/html/.buildinfo build/html/.doctrees
d78caf7
d78caf7
d78caf7
%install
d78caf7
%py3_install
d78caf7
d78caf7
d78caf7
%check
ea66042
%if 0%{?rhel} == 9
ea66042
# pytest 6; no support for pythonpath setting
58b2a83
sed -i -e '/^minversion/ d' pytest.ini
ea66042
%pytest --import-mode append
567fdfb
%elif 0%{?rhel} != 8
c97d689
%pytest
ea66042
%endif
d78caf7
d78caf7
d78caf7
%files -n python3-openslide
2e2f8f3
%doc CHANGELOG.md build/html
c97d689
%license COPYING.LESSER
d78caf7
%{python3_sitearch}/openslide/
d78caf7
%{python3_sitearch}/*.egg-info/
d78caf7
d78caf7
d78caf7
%changelog
e3624db
%autochangelog