%global srcname jiter %global _description %{summary}. Name: python-%{srcname} Version: 0.5.0 Release: %autorelease Summary: Fast iterable JSON parser License: MIT URL: https://github.com/pydantic/jiter/ Source0: %{pypi_source %{srcname}} # Upstream does not provide a license file inside the PyPi package. Source1: https://github.com/pydantic/jiter/blob/main/LICENSE BuildRequires: python3-devel BuildRequires: tomcli # For included rust code BuildRequires: rust-packaging >= 25 # For tests BuildRequires: python3dist(dirty-equals) BuildRequires: python3dist(pytest) %description %{_description} %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %{_description} %prep %autosetup -p1 -n %{srcname}-%{version} %cargo_prep # Move the LICENSE into place. cp %{SOURCE1} . # Remove the bencher dependency since we aren't running benchmarks. tomcli set crates/jiter/Cargo.toml del dev-dependencies.bencher # Patch the upstream source to avoid rebuilding jiter. tomcli set crates/jiter-python/Cargo.toml str dependencies.jiter.version "0.5.0" tomcli set crates/jiter-python/Cargo.toml del dependencies.jiter.path %generate_buildrequires %cargo_generate_buildrequires -a %pyproject_buildrequires %build export RUSTFLAGS="%build_rustflags" %pyproject_wheel %cargo_license_summary %{cargo_license} > LICENSE.dependencies %install %pyproject_install %pyproject_save_files %{srcname} %check %pyproject_check_import %pytest %files -n python3-%{srcname} -f %{pyproject_files} %license LICENSE LICENSE.dependencies %doc README.md %changelog %autochangelog