Use bundled rust deps in RHEL builds

RHEL does not include individual Rust crate dependencies.  Also,
python-hypothesis is not available in RHEL, but the tests proceed
without it.
This commit is contained in:
Yaakov Selkowitz 2023-09-12 10:39:12 -04:00
parent cffe288d29
commit a9bc99e47f
3 changed files with 18 additions and 4 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/rpds_py-0.9.2.tar.gz /rpds_py-0.9.2.tar.gz
/rpds_py-0.9.2-vendor.tar.xz

View File

@ -8,14 +8,24 @@ Summary: Python bindings to the Rust rpds crate
# Full license breakdown in LICENSES.dependencies # Full license breakdown in LICENSES.dependencies
License: MIT AND Apache-2.0 AND (MIT OR Apache-2.0) AND MPL-2.0 License: MIT AND Apache-2.0 AND (MIT OR Apache-2.0) AND MPL-2.0
URL: https://github.com/crate-py/rpds URL: https://github.com/crate-py/rpds
Source: %{pypi_source %{modname}} Source0: %{pypi_source %{modname}}
# To create the vendor tarball:
# tar xf %%{name}-%%{version}.crate ; pushd %%{name}-%%{version} ; \
# patch -p1 < ../bump-dependencies.patch && \
# cargo vendor && tar Jcvf ../%%{name}-%%{version}-vendor.tar.xz vendor/ ; pushd
Source1: %{modname}-%{version}-vendor.tar.xz
# Bump archery and rpds dependencies to v1.0.0 # Bump archery and rpds dependencies to v1.0.0
Patch: bump-dependencies.patch Patch: bump-dependencies.patch
%if 0%{?rhel}
BuildRequires: rust-toolset
%else
BuildRequires: cargo-rpm-macros BuildRequires: cargo-rpm-macros
%endif
BuildRequires: dos2unix BuildRequires: dos2unix
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-pytest
%global _description %{expand: %global _description %{expand:
Python bindings to the Rust rpds crate.} Python bindings to the Rust rpds crate.}
@ -41,18 +51,20 @@ dos2unix README* LICENSE* *.pyi
# The patch does not apply cleanly, we sed it out instead # The patch does not apply cleanly, we sed it out instead
sed -i '/hypothesis/d' tests/requirements.in sed -i '/hypothesis/d' tests/requirements.in
%cargo_prep %cargo_prep %{?rhel:-V 1}
%generate_buildrequires %generate_buildrequires
%pyproject_buildrequires tests/requirements.in %pyproject_buildrequires tests/requirements.in
%if %{undefined rhel}
%cargo_generate_buildrequires %cargo_generate_buildrequires
%endif
%build %build
export RUSTFLAGS='%{build_rustflags}' export RUSTFLAGS='%{build_rustflags}'
%cargo_license_summary %{?cargo_license_summary}
%{cargo_license} > LICENSES.dependencies %{?cargo_license} > LICENSES.dependencies
%pyproject_wheel %pyproject_wheel

View File

@ -1 +1,2 @@
SHA512 (rpds_py-0.9.2.tar.gz) = 5a3d1b4ca27cd9b73edf7c03c8def5350949a56df0a322e317a7d3e6e31933694fe21928218ebeb51074322dcde6e4f807283e0359f8f31b0ca6b69180be3260 SHA512 (rpds_py-0.9.2.tar.gz) = 5a3d1b4ca27cd9b73edf7c03c8def5350949a56df0a322e317a7d3e6e31933694fe21928218ebeb51074322dcde6e4f807283e0359f8f31b0ca6b69180be3260
SHA512 (rpds_py-0.9.2-vendor.tar.xz) = 03e411adfd845beef2ba3697dee3953351addcbd51b6b2009bca106cef32e31cc924c7cb7954fb1e3a03145093e11c579882eef850403729381aeb3842ea8b3a