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

# TODO adjust once this is implemented:
# https://bugzilla.redhat.com/show_bug.cgi?id=1935266
%global modname  jaraco
%global projname %{modname}.context
%global pkgname  %{modname}-context
%global srcname  %{modname}_context

# requires network access
%bcond_with tests

Name:           python-%{pkgname}
Version:        6.0.1
Release:        %autorelease
Summary:        Context managers by jaraco

License:        MIT
URL:            https://github.com/jaraco/%{projname}
Source0:        %{pypi_source %{srcname}}

BuildArch:      noarch

BuildRequires:  python3-devel
%if %{with tests}
BuildRequires:  git-core
%endif

%global _description %{expand:
Context managers by jaraco.}

%description %_description

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

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

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

# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -E -i '/\t"pytest-/d' pyproject.toml

%generate_buildrequires
%if %{with tests}
%pyproject_buildrequires -t
%else
%pyproject_buildrequires
%endif

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files %{modname}

%check
%if %{with tests}
%tox
%else
%pyproject_check_import
%endif

%files -n python3-%{pkgname} -f %{pyproject_files}
%license LICENSE
%doc README.rst NEWS.rst

%changelog
## START: Generated by rpmautospec
* Tue Aug 20 2024 Ondrej Mosnáček <omosnacek@gmail.com> - 6.0.1-1
- Update to version 6.0.1 (fedora#2306046)

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jun 22 2024 Ondrej Mosnáček <omosnacek@gmail.com> - 5.3.0-1
- Update to version 5.3.0 (fedora#2273523)

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

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

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

* Thu Sep 07 2023 Ondrej Mosnáček <omosnacek@gmail.com> - 4.3.0-1
- Initial import (fedora#2232628)
## END: Generated by rpmautospec