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

Name:           python-%{pypi_name}
Version:        0.10.0
Release:        %autorelease
Summary:        A simple, correct PEP517 package builder

License:        MIT
URL:            https://github.com/pypa/build
Source0:        %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz

BuildArch:      noarch

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}dist(setuptools)
BuildRequires:  python%{python3_pkgversion}dist(packaging)
BuildRequires:  python%{python3_pkgversion}dist(pep517)

%description
A simple, correct PEP517 package builder.


%package -n     python%{python3_pkgversion}-%{pypi_name}
Summary:        %{summary}

%description -n python%{python3_pkgversion}-%{pypi_name}
A simple, correct PEP517 package builder.


%pyproject_extras_subpkg -n python%{python3_pkgversion}-%{pypi_name} virtualenv


%prep
%autosetup -p1 -n %{pypi_name}-%{version}
# deprecated python3-toml is not needed on Python 3.11+
# upstream: https://github.com/pypa/build/pull/563
sed -Ei '/\btoml\b/d' pyproject.toml
# coverage is discouraged in Python packages
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
sed -Ei '/\bpytest-cov\b/d' pyproject.toml

%build
%pyproject_wheel

%install
%pyproject_install

%check
# The skipped tests require internet
%pytest -k "not (test_build_package or \
                 test_build_package_via_sdist or \
                 test_output[via-sdist-isolation] or \
                 test_output[wheel-direct-isolation] or \
                 test_wheel_metadata[True] or \
                 test_wheel_metadata_isolation or \
                 test_with_get_requires or \
                 test_build_sdist or \
                 test_build_wheel[from_sdist] or \
                 test_build_wheel[direct])"

%files -n python%{python3_pkgversion}-%{pypi_name}
%license LICENSE
%doc README.md
%{_bindir}/pyproject-build
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}*.dist-info

%changelog
## START: Generated by rpmautospec
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.10.0-7
- Rebuilt for Python 3.12

* Thu Jun 15 2023 Tomáš Hrnčiar <thrnciar@redhat.com> - 0.10.0-6
- Avoid fatal DeprecationWarnings on Python 3.12+

* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 0.10.0-5
- Rebuilt for Python 3.12

* Tue Jun 06 2023 Miro Hrončok <miro@hroncok.cz> - 0.10.0-4
- Do not BuildRequire pytest-cov, it is discouraged and was not needed

* Thu Mar 16 2023 Lumir Balhar <lbalhar@redhat.com> - 0.10.0-3
- Use upstream patch to fix tests instead of sed

* Wed Mar 15 2023 Lumir Balhar <lbalhar@redhat.com> - 0.10.0-2
- Fix FTBFS by hotfixing tests

* Fri Jan 20 2023 Lumir Balhar <lbalhar@redhat.com> - 0.10.0-1
- Update to 0.10.0 (rhbz#2160265)

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

* Mon Jan 16 2023 Miro Hrončok <mhroncok@redhat.com> - 0.9.0-2
- Drop redundant BuildRequries for deprecated python3-toml
- https://fedoraproject.org/wiki/Changes/DeprecatePythonToml

* Sun Oct 30 2022 Lumír Balhar <lbalhar@redhat.com> - 0.9.0-1
- Update to 0.9.0
Resolves: rhbz#2138145

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

* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 0.8.0-3
- Rebuilt for Python 3.11

* Tue May 24 2022 Miro Hrončok <mhroncok@redhat.com> - 0.8.0-2
- Package the build[virtualenv] extra

* Mon May 23 2022 Lumír Balhar <lbalhar@redhat.com> - 0.8.0-1
- Update to 0.8.0
Resolves: rhbz#2089034

* Fri Mar 18 2022 Miro Hrončok <mhroncok@redhat.com> - 0.7.0-3
- Fix virtualenv creation by using the "venv" sysconfig installation scheme
- Resolves: rhbz#2059268

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

* Mon Sep 20 2021 Lumír Balhar <lbalhar@redhat.com> - 0.7.0-1
- Update to 0.7.0
Resolves: rhbz#2005146

* Wed Aug 04 2021 Lumír Balhar <lbalhar@redhat.com> - 0.6.0-1
- Update to 0.6.0
Resolves: rhbz#1989297

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

* Thu Jun 24 2021 Lumír Balhar <lbalhar@redhat.com> - 0.5.1-1
- Initial package.

## END: Generated by rpmautospec
