## START: Set by rpmautospec
## (rpmautospec version 0.6.0)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 9;
    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 desc %{expand: \
This package provides straightforward implementation of benchmarking
functions for optimization tasks.}

# do not build docs for now - missing dependency
%bcond_with docs

%bcond_without tests

%global forgeurl https://github.com/gugarosa/opytimark

Name:           python-opytimark
Version:        1.0.8
Release:        %autorelease
Summary:        Python implementation of Optimization Benchmarking Functions

%forgemeta

License:        Apache-2.0
URL:            https://github.com/gugarosa/opytimark
Source0:        %forgesource

# Move dev dependencies
# https://github.com/gugarosa/opytimark/pull/2
Patch:          %{url}/pull/2.patch

BuildArch:      noarch

%description
%{desc}

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

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

# sphinx-autoapi is missing
%if %{with docs}
BuildRequires:  make
BuildRequires:  python3-sphinx-latex
BuildRequires:  latexmk
BuildRequires:  %{py3_dist sphinx}
BuildRequires:  %{py3_dist sphinx-rtd-theme}
%endif

%description -n python3-opytimark
%{desc}

%if %{with docs}
%package doc
BuildArch:      noarch
Summary:        %{summary}

%description doc
Documentation for %{name}.
%endif

%prep
%forgeautosetup -p1

%generate_buildrequires
%pyproject_buildrequires -r

%build
%pyproject_wheel

%if %{with docs}
%make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}'
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
%endif

%install
%pyproject_install
%pyproject_save_files opytimark

%check

# several tests are failing -- will examine them later
%if %{with tests}
%pytest -k 'not test_year and not test_decorator and not test_loader and not cec_benchmark'
%endif

%files -n python3-opytimark -f %{pyproject_files}
%doc README.md

%if %{with docs}
%files doc
%license LICENSE
%doc CODE_OF_CONDUCT.md
%doc docs/_build/latex/opytimark.pdf
%endif

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

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

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

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

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

* Mon Jul 10 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.8-4
- Do not BR unnecessary dev dependencies (fix RHBZ#2220381)
- Backport PR#2 from upstream

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

* Tue Nov 22 2022 Iztok Fister Jr <iztok@iztok-jr-fister.eu> - 1.0.8-2
- Convert to rpmautospec

* Tue Nov 22 2022 Iztok Fister Jr <iztok@iztok-jr-fister.eu> - 1.0.8-1
- Initial import (fedora#2144033).
## END: Generated by rpmautospec