2021-03-09 10:09:03 +00:00
|
|
|
%if 0%{?rhel}
|
|
|
|
%bcond_with tests
|
|
|
|
%else
|
|
|
|
%bcond_without tests
|
|
|
|
%endif
|
|
|
|
|
2021-01-14 20:11:20 +00:00
|
|
|
Name: python-setuptools-rust
|
2023-08-23 04:56:42 +00:00
|
|
|
Version: 1.7.0
|
2021-11-22 07:06:50 +00:00
|
|
|
Release: %autorelease
|
2021-01-14 20:11:20 +00:00
|
|
|
Summary: Setuptools Rust extension plugin
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/PyO3/setuptools-rust
|
|
|
|
Source0: %{pypi_source setuptools-rust}
|
|
|
|
BuildArch: noarch
|
|
|
|
ExclusiveArch: %{rust_arches}
|
|
|
|
|
|
|
|
BuildRequires: python3-devel
|
2021-02-11 06:21:06 +00:00
|
|
|
%if 0%{?fedora}
|
2023-03-01 22:25:34 +00:00
|
|
|
BuildRequires: rust-packaging
|
2021-02-11 06:21:06 +00:00
|
|
|
%else
|
2021-02-11 14:31:54 +00:00
|
|
|
# RHEL has rust-toolset and neither setuptools-scm nor wheel
|
|
|
|
BuildRequires: rust-toolset >= 1.45
|
2021-02-11 06:21:06 +00:00
|
|
|
%endif
|
2021-03-09 10:09:03 +00:00
|
|
|
%if %{with tests}
|
|
|
|
BuildRequires: rust-pyo3+default-devel
|
|
|
|
%endif
|
2021-01-14 20:11:20 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Setuptools helpers for Rust Python extensions. Compile and distribute Python
|
|
|
|
extensions written in Rust as easily as if they were written in C.
|
|
|
|
|
|
|
|
%package -n python3-setuptools-rust
|
|
|
|
Summary: %{summary}
|
2021-02-11 14:31:54 +00:00
|
|
|
%if 0%{?fedora}
|
2023-03-01 22:25:34 +00:00
|
|
|
Requires: rust-packaging
|
2021-02-11 14:31:54 +00:00
|
|
|
%else
|
|
|
|
Requires: rust-toolset >= 1.45
|
|
|
|
%endif
|
2021-01-14 20:11:20 +00:00
|
|
|
|
|
|
|
%description -n python3-setuptools-rust
|
|
|
|
Setuptools helpers for Rust Python extensions. Compile and distribute Python
|
|
|
|
extensions written in Rust as easily as if they were written in C.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n setuptools-rust-%{version}
|
|
|
|
# Remove bundled egg-info
|
|
|
|
rm -rf setuptools-rust.egg-info
|
|
|
|
|
2021-02-11 06:21:06 +00:00
|
|
|
%if ! 0%{?fedora}
|
2023-08-23 04:56:42 +00:00
|
|
|
# RHEL doesn't have setuptools-scm, releases come with version.py
|
|
|
|
sed 's/"setuptools_scm"//' pyproject.toml
|
2021-02-11 06:21:06 +00:00
|
|
|
%endif
|
|
|
|
|
2023-08-23 04:56:42 +00:00
|
|
|
%generate_buildrequires
|
|
|
|
%pyproject_buildrequires
|
2021-02-11 06:21:06 +00:00
|
|
|
|
2021-01-14 20:11:20 +00:00
|
|
|
%build
|
2023-08-23 04:56:42 +00:00
|
|
|
%pyproject_wheel
|
2021-01-14 20:11:20 +00:00
|
|
|
|
|
|
|
%install
|
2023-08-23 04:56:42 +00:00
|
|
|
%pyproject_install
|
|
|
|
%pyproject_save_files setuptools_rust
|
2021-01-14 20:11:20 +00:00
|
|
|
|
2021-02-11 06:21:06 +00:00
|
|
|
%check
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
|
|
|
%{__python3} -c "from setuptools_rust import RustExtension, version"
|
|
|
|
|
2021-03-09 10:09:03 +00:00
|
|
|
%if %{with tests}
|
2023-08-23 04:56:42 +00:00
|
|
|
cd examples/hello-world-setuppy
|
2021-03-09 10:09:03 +00:00
|
|
|
%cargo_prep
|
|
|
|
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} setup.py build
|
|
|
|
cd ../..
|
|
|
|
%endif
|
|
|
|
|
2023-08-23 04:56:42 +00:00
|
|
|
%files -n python3-setuptools-rust -f %{pyproject_files}
|
2021-01-14 20:11:20 +00:00
|
|
|
%doc README.md CHANGELOG.md
|
|
|
|
%license LICENSE
|
|
|
|
|
|
|
|
%changelog
|
2021-11-22 07:06:50 +00:00
|
|
|
%autochangelog
|