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

# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
# We can generate PDF documentation as a substitute.
%bcond_without doc_pdf

%global pypi_name meautility
%global pretty_name MEAutility

%global _description %{expand:
Python package for multi-electrode array (MEA) handling and stimulation.
Documentation is available at https://meautility.readthedocs.io/}

Name:           python-%{pypi_name}
Version:        1.5.1
Release:        %autorelease
Summary:        Package for multi-electrode array (MEA) handling and stimulation

License:        GPLv3
URL:            https://github.com/alejoe91/%{pretty_name}/
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch

%description %_description

%package -n python3-%{pypi_name}
Summary:        %{summary}
BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  %{py3_dist pytest}
%endif

%description -n python3-%{pypi_name} %_description

%package        doc
Summary:        Documentation for %{pretty_name}

%if %{with doc_pdf}
BuildRequires:  make
BuildRequires:  %{py3_dist Sphinx}
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
%endif

%description doc %_description

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

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%if %{with doc_pdf}
PYTHONPATH="${PWD}:${PWD}/MEAutility" \
    %make_build -C docs latex SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/build/latex LATEXMKOPTS='-quiet'
%endif

%install
%pyproject_install
%pyproject_save_files -l %{pretty_name}

%check
%if %{with tests}
%{pytest}
%endif

%files -n python3-%{pypi_name} -f %{pyproject_files}
%doc README.md
%exclude %{python3_sitelib}/MEAutility/tests

%files doc
%license LICENSE
%doc notebooks
%if %{with doc_pdf}
%doc docs/build/latex/MEAutility.pdf
%endif

%changelog
## START: Generated by rpmautospec
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

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

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

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

* Wed Jan 03 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.1-8
- Assert that the .dist-info directory contains a license file

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

* Tue Jun 27 2023 Python Maint <python-maint@redhat.com> - 1.5.1-5
- Rebuilt for Python 3.12

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

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

* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.5.1-2
- Rebuilt for Python 3.11

* Fri May 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.1-1
- Update to 1.5.1 (close RHBZ#2082495)

* Fri May 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-5
- Drop -r, now the default, from %%%%pyproject_buildrequires

* Fri May 06 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-4
- Reduce LaTeX build verbosity

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

* Tue Oct 19 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.5.0-1
- Upgrade to 1.5.0 (close RHBZ#2012846)
- Switch to pyproject-rpm-macros
- Ensure tests are not packaged
- Build Sphinx-generated PDF documentation and add a -doc subpackage

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

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

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

* Fri Nov 27 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.4.8-1
- Remove docs: bundle fonts
- Remove unneeded comments
- Use pytest macro

* Thu Nov 26 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.4.8-1
- Initial build

## END: Generated by rpmautospec