## START: Set by rpmautospec
## (rpmautospec version 0.3.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 15;
    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  re-assert
%global slugname re_assert
%global forgeurl https://github.com/asottile/re-assert

%global common_description %{expand:
Show where your regex match assertion failed!}

%bcond_without tests

Name:           python-%{srcname}
Version:        1.1.0
%forgemeta
Release:        %autorelease
Summary:        Show where your regex match assertion failed!
URL:            %{forgeurl}
Source:         %{forgesource}
Patch:          0001_adding_pytest_to_the_testing_dependencies.patch
# SPDX
License:        MIT
BuildArch:      noarch
BuildRequires:  python3-devel

%description %{common_description}

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

%prep
%forgeautosetup -p1

%generate_buildrequires
%pyproject_buildrequires %{?with_tests:-x test}

%build
%pyproject_wheel

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

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

%files -n python3-%{srcname} -f %{pyproject_files}

%changelog
* Tue Jan 02 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-15
- Assert that %%pyproject_files contains a license file

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

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

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

* Fri Oct 14 2022 chedi toueiti <chedi.toueiti@gmail.com> - 1.1.0-11
- updating the build script to the latest guidelines

* Thu Oct 13 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-10
- Confirm License is SPDX MIT

* Thu Oct 13 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-9
- Drop a trailing blank line in the description

* Thu Oct 13 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 1.1.0-8
- Run the tests from the GitHub archive

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

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.1.0-6
- Rebuilt for Python 3.11

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

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

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

* Mon Apr 19 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.1.0-2
- BuildRequire setuptools explicitly

* Tue Mar 23 2021 chedi <chedi.toueiti@gmail.com> - 1.1.0-1
- initial commit