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

%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
Source:         %forgesource

# Move dev dependencies
# https://github.com/gugarosa/opytimark/pull/2
Patch:          %{url}/pull/2.patch
# fix(tests): Fixes rounding for Python 3.8 and 3.9.
# https://github.com/gugarosa/opytimark/commit/7f5f97e9d042d9b9d9acf1cdcc9738fe99c792c5
Patch:          %{url}/commit/7f5f97e9d042d9b9d9acf1cdcc9738fe99c792c5.patch
# Fix warning (description_file)
# https://github.com/gugarosa/opytimark/commit/25d9adb743c8483c0f2ae41f56c8872fdd44977f
Patch:          %{url}/commit/25d9adb743c8483c0f2ae41f56c8872fdd44977f.patch

BuildArch:      noarch

%global desc %{expand:
This package provides straightforward implementation of benchmarking functions
for optimization tasks.}

%description %{desc}

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

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

%description -n python3-opytimark %{desc}

%prep
%forgeautosetup -p1

%generate_buildrequires
%pyproject_buildrequires

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files -l opytimark

%check
%if %{with tests}
# All of these require network access.
k="${k-}${k+ and }not test_year"
k="${k-}${k+ and }not test_decorator"
k="${k-}${k+ and }not test_loader"
k="${k-}${k+ and }not cec_benchmark"
%pytest -k "${k-}"
%endif

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

%changelog
## START: Generated by rpmautospec
* Sat Nov 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.8-18
- Assert that .dist-info contains a license file

* Sat Nov 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.8-14
- Fix warning (description_file)

* Sat Nov 23 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.0.8-13
- Make two tests less brittle with respect to floating-point rounding
- Fixes RHBZ#2328017

* 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