2023-07-20 18:42:27 +00:00
|
|
|
%global srcname rpds-py
|
|
|
|
%global modname rpds_py
|
|
|
|
|
|
|
|
Name: python-rpds-py
|
2023-12-10 08:32:08 +00:00
|
|
|
Version: 0.13.2
|
2023-07-20 18:42:27 +00:00
|
|
|
Release: %autorelease
|
|
|
|
Summary: Python bindings to the Rust rpds crate
|
|
|
|
# Full license breakdown in LICENSES.dependencies
|
|
|
|
License: MIT AND Apache-2.0 AND (MIT OR Apache-2.0) AND MPL-2.0
|
|
|
|
URL: https://github.com/crate-py/rpds
|
2023-11-27 00:51:39 +00:00
|
|
|
Source: %{pypi_source %{modname}}
|
2023-09-12 14:39:12 +00:00
|
|
|
# To create the vendor tarball:
|
2023-10-12 15:49:56 +00:00
|
|
|
# tar xf %%{modname}-%%{version}.tar.gz ; pushd %%{modname}-%%{version} ; \
|
|
|
|
# cargo vendor && tar Jcvf ../%%{modname}-%%{version}-vendor.tar.xz vendor/ ; pushd
|
2023-11-27 00:51:39 +00:00
|
|
|
Source: %{modname}-%{version}-vendor.tar.xz
|
2023-07-20 18:42:27 +00:00
|
|
|
|
2023-09-12 14:39:12 +00:00
|
|
|
%if 0%{?rhel}
|
|
|
|
BuildRequires: rust-toolset
|
|
|
|
%else
|
2023-07-20 18:42:27 +00:00
|
|
|
BuildRequires: cargo-rpm-macros
|
2023-09-12 14:39:12 +00:00
|
|
|
%endif
|
2023-07-20 18:42:27 +00:00
|
|
|
BuildRequires: dos2unix
|
|
|
|
BuildRequires: python3-devel
|
2023-09-12 14:39:12 +00:00
|
|
|
BuildRequires: python3-pytest
|
2023-07-20 18:42:27 +00:00
|
|
|
|
|
|
|
%global _description %{expand:
|
|
|
|
Python bindings to the Rust rpds crate.}
|
|
|
|
|
|
|
|
%description %_description
|
|
|
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
Summary: %{summary}
|
|
|
|
|
|
|
|
%description -n python3-%{srcname} %_description
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1 -n %{modname}-%{version}
|
|
|
|
|
|
|
|
# Fix line terminations
|
|
|
|
dos2unix README* LICENSE* *.pyi
|
|
|
|
|
2023-09-12 14:39:12 +00:00
|
|
|
%cargo_prep %{?rhel:-V 1}
|
2023-11-27 00:51:39 +00:00
|
|
|
rm -f Cargo.lock
|
2023-07-20 18:42:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%pyproject_buildrequires tests/requirements.in
|
2023-09-12 14:39:12 +00:00
|
|
|
%if %{undefined rhel}
|
2023-07-20 18:42:27 +00:00
|
|
|
%cargo_generate_buildrequires
|
2023-09-12 14:39:12 +00:00
|
|
|
%endif
|
2023-07-20 18:42:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
export RUSTFLAGS='%{build_rustflags}'
|
2023-11-27 00:51:39 +00:00
|
|
|
%cargo_license_summary
|
|
|
|
%{cargo_license} > LICENSES.dependencies
|
2023-07-20 18:42:27 +00:00
|
|
|
%pyproject_wheel
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%pyproject_install
|
|
|
|
|
|
|
|
%pyproject_save_files rpds
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
%pytest -vv
|
|
|
|
|
|
|
|
|
|
|
|
%files -n python3-%{srcname} -f %{pyproject_files}
|
|
|
|
%license LICENSE LICENSES.dependencies
|
|
|
|
%doc README.rst
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
%autochangelog
|