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

Name:           python-%{srcname}
Version:        0.17.0
Release:        %autorelease
Summary:        A Rust-like result type for Python

License:        MIT
URL:            https://github.com/rustedpy/result
# pypi wheel does not contain tests
Source:         %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
Patch:          %{srcname}-no-cov.diff

BuildArch:      noarch
BuildRequires:  python3-devel
# requirements-dev.txt has extras we don't need
BuildRequires:  python3dist(pytest)

%global _description %{expand:
A simple Result type for Python 3 inspired by Rust, fully type annotated.

The idea is that a result value can be either `Ok(value)` or `Err(error)`, with
a way to differentiate between the two. `Ok` and `Err` are both classes
encapsulating an arbitrary value. `Result[T, E]` is a generic type alias for
`typing.Union[Ok[T], Err[E]]`.}

%description %_description

%package -n python3-%{srcname}
Summary:        %{summary}

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


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


%generate_buildrequires
%pyproject_buildrequires -r 


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files %{srcname}


%check
%pytest -v
%if 0%{?python3_version_nodots} >= 310
%pytest -v tests/test_pattern_matching.py
%endif


%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.*


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

* Thu Jun 27 2024 Packit <hello@packit.dev> - 0.17.0-1
- Update to 0.17.0 upstream release
- Resolves: rhbz#2214092

* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.10.0-6
- Rebuilt for Python 3.13

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

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

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

* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.10.0-2
- Rebuilt for Python 3.12

* Tue May 16 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.10.0-1
- Update to 0.10.0

* Sun Feb 12 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.9.0-2
- Add missing patch

* Sun Feb 12 2023 Michel Alexandre Salim <salimma@fedoraproject.org> - 0.9.0-1
- Initial Fedora package
## END: Generated by rpmautospec