Name: python-y-py Version: 0.5.5 Release: 1%{?dist} Summary: Python bindings for the Y-CRDT built from yrs (Rust) # y-py and bundled yrs and lib0 are MIT, pyo3 is Apache-2.0 License: MIT and Apache-2.0 URL: https://pypi.org/project/y-py/ Source: %{pypi_source y_py} # Bundled dependencies # The package needs lib0, yrs and pyo3: # lib0 is ready for review, but the version is too new # for this package: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2153697 # version needed: 0.12.2, latest version: 0.14.1 # upstream issue: https://github.com/y-crdt/ypy/issues/106 # yrs is the same as lib0, they are from the same project # review request: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2153703 # version needed: 0.12.2, latest version: 0.14.1 # pyo3 is more complicated because it's already in Fedora # and some important packages depend on it. # update bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2061101 # version needed: 0.16.5, version in Fedora: 0.15.2, latest version: 0.17.3 # # This archive can be generated by update-vendored-tarball.sh # after a version bump here. Dependencies for windows are removed. Source: y_py-%{version}-vendor.tar.gz ExclusiveArch: %{rust_arches} BuildRequires: python3-devel BuildRequires: python3-pytest # Provides for bundled dependencies # generated by this command in unpacked sources: # cargo metadata --locked --format-version 1 | CRATE_NAME="y-py" ../bundled-provides.jq # # And yes, there are some windows dependencies but it'd be very hard # to patch them out and the build doesn't work without them. # The dependency tree is pyo3 → parking_lot → parking_lot_core → windows-sys Provides: bundled(crate(autocfg)) = 1.1.0 Provides: bundled(crate(bitflags)) = 1.3.2 Provides: bundled(crate(bumpalo)) = 3.11.1 Provides: bundled(crate(cfg-if)) = 1.0.0 Provides: bundled(crate(getrandom)) = 0.1.16 Provides: bundled(crate(indoc)) = 1.0.7 Provides: bundled(crate(js-sys)) = 0.3.60 Provides: bundled(crate(lib0)) = 0.12.2 Provides: bundled(crate(libc)) = 0.2.138 Provides: bundled(crate(lock_api)) = 0.4.9 Provides: bundled(crate(log)) = 0.4.17 Provides: bundled(crate(once_cell)) = 1.16.0 Provides: bundled(crate(parking_lot)) = 0.12.1 Provides: bundled(crate(parking_lot_core)) = 0.9.5 Provides: bundled(crate(ppv-lite86)) = 0.2.17 Provides: bundled(crate(proc-macro2)) = 1.0.47 Provides: bundled(crate(pyo3)) = 0.16.6 Provides: bundled(crate(pyo3-build-config)) = 0.16.6 Provides: bundled(crate(pyo3-ffi)) = 0.16.6 Provides: bundled(crate(pyo3-macros)) = 0.16.6 Provides: bundled(crate(pyo3-macros-backend)) = 0.16.6 Provides: bundled(crate(quote)) = 1.0.21 Provides: bundled(crate(rand)) = 0.7.3 Provides: bundled(crate(rand_chacha)) = 0.2.2 Provides: bundled(crate(rand_core)) = 0.5.1 Provides: bundled(crate(rand_hc)) = 0.2.0 Provides: bundled(crate(redox_syscall)) = 0.2.16 Provides: bundled(crate(scopeguard)) = 1.1.0 Provides: bundled(crate(smallstr)) = 0.2.0 Provides: bundled(crate(smallvec)) = 1.10.0 Provides: bundled(crate(syn)) = 1.0.105 Provides: bundled(crate(target-lexicon)) = 0.12.5 Provides: bundled(crate(thiserror)) = 1.0.37 Provides: bundled(crate(thiserror-impl)) = 1.0.37 Provides: bundled(crate(unicode-ident)) = 1.0.5 Provides: bundled(crate(unindent)) = 0.1.10 Provides: bundled(crate(wasi)) = 0.9.0+wasi_snapshot_preview1 Provides: bundled(crate(wasm-bindgen)) = 0.2.83 Provides: bundled(crate(wasm-bindgen-backend)) = 0.2.83 Provides: bundled(crate(wasm-bindgen-macro)) = 0.2.83 Provides: bundled(crate(wasm-bindgen-macro-support)) = 0.2.83 Provides: bundled(crate(wasm-bindgen-shared)) = 0.2.83 Provides: bundled(crate(windows-sys)) = 0.42.0 Provides: bundled(crate(windows_aarch64_gnullvm)) = 0.42.0 Provides: bundled(crate(windows_aarch64_msvc)) = 0.42.0 Provides: bundled(crate(windows_i686_gnu)) = 0.42.0 Provides: bundled(crate(windows_i686_msvc)) = 0.42.0 Provides: bundled(crate(windows_x86_64_gnu)) = 0.42.0 Provides: bundled(crate(windows_x86_64_gnullvm)) = 0.42.0 Provides: bundled(crate(windows_x86_64_msvc)) = 0.42.0 Provides: bundled(crate(yrs)) = 0.12.2 %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} # 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 = https://github.com/y-crdt/ypy long_description = file: README.md long_description_content_type = text/markdown [options] zip_safe = False setup_requires = setuptools-rust python_requires = >=3.6 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"])], ) EOF # Handling of bundled dependencies tar xvf %{SOURCE1} mkdir -p .cargo cat >.cargo/config << EOF [build] rustc = "%{__rustc}" rustdoc = "%{__rustdoc}" rustflags = %{__global_rustflags_toml} [install] root = "%{buildroot}%{_prefix}" [term] verbose = true [source.crates-io] replace-with = "vendored-sources" [source.vendored-sources] directory = "vendor" EOF %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