%global _empty_manifest_terminate_build 0
Name:		python-rpds-py
Version:	0.10.6
Release:	1
Summary:	Python bindings to Rust's persistent data structures (rpds).
License:	MIT
URL:		https://github.com/crate-py/rpds
Source0:	https://files.pythonhosted.org/packages/ee/12/d6cfa2699916e5ece53a42e486e03b5a14e672c76ddb16d4649efcf9efb8/rpds_py-0.10.6.tar.gz
Source1:        cargo-vendor-cache

BuildRequires:  rust-packaging

BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:	python3-pbr
BuildRequires:	python3-pip
BuildRequires:  python3-wheel
BuildRequires:  python3-hatchling
BuildRequires:  python3-maturin

%description
Python bindings to Rust's persistent data structures (rpds).


%package -n python3-rpds-py
Summary:	Python bindings to Rust's persistent data structures (rpds).
Provides:	python-rpds-py
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:  python3-hatchling
%description -n python3-rpds-py
Python bindings to Rust's persistent data structures (rpds).

%package help
Summary:	Development documents and examples for rpds-py
Provides:	python3-rpds-py-doc

%description help
Development documents and examples for rpds-py.

%prep
%autosetup -n rpds_py-%{version}
tar xzvf %{SOURCE1} -C .
mkdir .cargo
cat >> .cargo/config.toml << EOF
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
EOF

%build
%pyproject_build

%install
%pyproject_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi

%files -n python3-rpds-py
%doc README.rst
%license LICENSE
%{python3_sitearch}/rpds
%{python3_sitearch}/rpds_py*.dist-info/


%files help
%{_docdir}/*

%changelog
* Thu Nov 2 2023 Dongxing Wang <dxwangk@isoftstone.com> - 0.10.6-1
- Init package
