Name: python-y-py Version: 0.5.5 Release: 1%{?dist} Summary: Python bindings for the Y-CRDT built from yrs (Rust) License: MIT URL: https://github.com/y-crdt/ypy Source: %{pypi_source y_py} BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: rust-packaging %global _description %{expand: Ypy is a Python binding for Y-CRDT. It provides distributed data types that enable real-time collaboration between devices.} %description %_description %package -n python3-y-py Summary: %{summary} %description -n python3-y-py %_description %prep %autosetup -p1 -n y_py-%{version} %cargo_prep # Porting from maturin to setuptools_rust # This is far from perfect but because maturin (a popular # build backend for Rust packages) is not yet available # in Fedora, we have to use setuptools-rust instead # which requires multiple changes in metadata. cat << EOF > MANIFEST.in include Cargo.toml recursive-include src * EOF cat << EOF > pyproject.toml [build-system] requires = ["setuptools", "wheel", "setuptools-rust"] EOF cat << EOF > setup.cfg [metadata] name = y-py version = %{version} license = MIT url = %{url} long_description = file: README.md long_description_content_type = text/markdown [options] zip_safe = False include_package_data = True EOF cat << EOF > setup.py import sys from setuptools import setup from setuptools_rust import RustExtension setup( rust_extensions=[RustExtension("y_py", args=["--offline"], rustc_flags="%build_rustflags".split())], ) EOF %generate_buildrequires %cargo_generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files y_py %check %pytest %files -n python3-y-py -f %{pyproject_files} %doc README.md %changelog * Thu Dec 15 2022 Lumír Balhar - 0.5.5-1 - Initial package