## START: Set by rpmautospec
## (rpmautospec version 0.3.1)
## 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

Name:           python-pyproject-api
Version:        1.5.0
Release:        %autorelease
Summary:        API to interact with the python pyproject.toml based projects

License:        MIT
URL:            https://pyproject-api.readthedocs.org
Source0:        https://files.pythonhosted.org/packages/source/p/pyproject-api/pyproject_api-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-pytest-mock
BuildRequires:  python%{python3_pkgversion}-virtualenv
BuildRequires:  pyproject-rpm-macros

%global _description %{expand:
API to interact with the python pyproject.toml based projects.}

%description %_description

%package -n     python%{python3_pkgversion}-pyproject-api
Summary:        %{summary}

%description -n python%{python3_pkgversion}-pyproject-api %_description

%prep
%autosetup -n pyproject_api-%{version}
# Remove unneeded testing deps
sed -i "/covdefaults/d;/pytest-cov/d" pyproject.toml

%if 0%{?rhel}
%generate_buildrequires
%pyproject_buildrequires -w -x testing
%endif

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files pyproject_api

%check
# We don't want to depend on Python 2
%pytest -k "not test_can_build_on_python_2"

%files -n python%{python3_pkgversion}-pyproject-api -f %{pyproject_files}
%doc README.md

%changelog
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Jan 18 2023 Lumir Balhar <lbalhar@redhat.com> - 1.5.0-1
- Update to 1.5.0 (rhbz#2161818)

* Thu Jan 05 2023 Lumir Balhar <lbalhar@redhat.com> - 1.4.0-1
- Update to 1.4.0 (rhbz#2158206)

* Tue Jan 03 2023 Lumír Balhar <lbalhar@redhat.com> - 1.3.0-1
- Update to 1.3.0 (rhbz#2157941)

* Wed Dec 07 2022 Lumír Balhar <lbalhar@redhat.com> - 1.2.1-1
- Update to 1.2.1 (rhbz#2150693)

* Tue Nov 01 2022 Lumír Balhar <lbalhar@redhat.com> - 1.1.2-1
- Update to 1.1.2
Resolves: rhbz#2138752

* Tue Sep 13 2022 Lumír Balhar <lbalhar@redhat.com> - 1.1.1-1
- Update to 1.1.1
Resolves: rhbz#2126242

* Sun Sep 11 2022 Lumír Balhar <lbalhar@redhat.com> - 1.1.0-1
- Update to 1.1.0
Resolves: rhbz#2125780

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

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

* Mon Feb 07 2022 Lumír Balhar <lbalhar@redhat.com> - 0.1.1-1
- Initial package