python3.14-flit-core/SPECS/python3.14-flit-core.spec
2026-04-16 04:56:20 -04:00

130 lines
3.8 KiB
RPMSpec

## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 6;
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 python3_pkgversion 3.14
# When bootstrapping new Python we need to build flit in bootstrap mode.
# The Python RPM dependency generators and pip are not yet available.
%bcond bootstrap 0
# RHEL: disable tests due to missing dependencies
%bcond tests 0
Name: python%{python3_pkgversion}-flit-core
Version: 3.12.0
Release: %autorelease
Summary: PEP 517 build backend for packages using Flit
# flit-core is BSD-3-Clause
# flit_core/versionno.py contains a regex that is from packaging, BSD-2-Clause
License: BSD-3-Clause AND BSD-2-Clause
URL: https://flit.pypa.io/
Source: %{pypi_source flit_core}
BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel
%if %{without bootstrap}
BuildRequires: python%{python3_pkgversion}-pip
%endif
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-pytest
# Test deps that require flit-core to build:
BuildRequires: python%{python3_pkgversion}-testpath
%endif
%global _description %{expand:
This provides a PEP 517 build backend for packages using Flit.
The only public interface is the API specified by PEP 517,
at flit_core.buildapi.}
%description %_description
# RPM generators are not yet available when we bootstrap in Fedora,
# in RHEL we bootstrap the same way
%if %{with bootstrap}
Provides: python%{python3_pkgversion}dist(flit-core) = %{version}
Provides: python%{python3_pkgversion}dist(flit-core) = %{version}
Requires: python(abi) = %{python3_pkgversion}
%endif
%prep
%autosetup -p1 -n flit_core-%{version}
# Remove vendored tomli that flit_core includes to solve the circular dependency on older Pythons
# (flit_core requires tomli, but flit_core is needed to build tomli).
# We don't use this, as tomllib is a part of standard library since Python 3.11.
# Remove the bits looking for the license files of the vendored tomli.
rm -rf flit_core/vendor
sed -iE 's/, *"flit_core\/vendor\/\*\*\/LICENSE\*"//' pyproject.toml
%if %{without bootstrap}
%generate_buildrequires
%pyproject_buildrequires
%endif
%build
%if %{with bootstrap}
%{python3} -m flit_core.wheel
%else
%pyproject_wheel
%endif
%install
%if %{with bootstrap}
%{python3} bootstrap_install.py --install-root %{buildroot} dist/flit_core-%{version}-py3-none-any.whl
# for consistency with %%pyproject_install/brp-python-rpm-in-distinfo:
echo rpm > %{buildroot}%{python3_sitelib}/flit_core-%{version}.dist-info/INSTALLER
rm %{buildroot}%{python3_sitelib}/flit_core-%{version}.dist-info/RECORD
%else
%pyproject_install
%endif
%check
%py3_check_import flit_core flit_core.buildapi
%if %{with tests}
%pytest
%endif
%files -n python%{python3_pkgversion}-flit-core
%doc README.rst
%{python3_sitelib}/flit_core-*.dist-info/
%license %{python3_sitelib}/flit_core-*.dist-info/licenses/LICENSE
%{python3_sitelib}/flit_core/
%changelog
## START: Generated by rpmautospec
* Mon Dec 08 2025 Miro Hrončok <miro@hroncok.cz> - 3.12.0-6
- Remove redundant BuildRequires on python3.14-rpm-macros
* Fri Nov 28 2025 Lumir Balhar <lbalhar@redhat.com> - 3.12.0-5
- Disable bootstrap
* Fri Nov 28 2025 Lukáš Zachar <lzachar@redhat.com> - 3.12.0-4
- forgotten variable
* Fri Nov 28 2025 Lukáš Zachar <lzachar@redhat.com> - 3.12.0-3
- Add gating.yaml
* Fri Nov 28 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0-2
- Convert from Fedora for the Python 3.14 stack in RHEL
* Tue Nov 25 2025 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.12.0-1
- RHEL: Rename SPEC to python3.14-flit-core.spec
## END: Generated by rpmautospec