|
|
6bdabb |
%global __python3 /usr/bin/python3.11
|
|
|
6bdabb |
%global python3_pkgversion 3.11
|
|
|
6bdabb |
|
|
|
6bdabb |
%if 0%{?rhel}
|
|
|
6bdabb |
%bcond_with tests
|
|
|
6bdabb |
%else
|
|
|
6bdabb |
%bcond_without tests
|
|
|
6bdabb |
%endif
|
|
|
6bdabb |
|
|
|
6bdabb |
Name: python%{python3_pkgversion}-setuptools-rust
|
|
|
6bdabb |
Version: 1.5.2
|
|
|
6bdabb |
Release: 1%{?dist}
|
|
|
6bdabb |
Summary: Setuptools Rust extension plugin
|
|
|
6bdabb |
|
|
|
6bdabb |
License: MIT
|
|
|
6bdabb |
URL: https://github.com/PyO3/setuptools-rust
|
|
|
6bdabb |
Source0: %{pypi_source setuptools-rust}
|
|
|
6bdabb |
BuildArch: noarch
|
|
|
6bdabb |
ExclusiveArch: %{rust_arches}
|
|
|
6bdabb |
|
|
|
6bdabb |
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
6bdabb |
BuildRequires: python%{python3_pkgversion}-rpm-macros
|
|
|
6bdabb |
BuildRequires: python%{python3_pkgversion}-setuptools > 46.1
|
|
|
6bdabb |
BuildRequires: python%{python3_pkgversion}-semantic_version >= 2.8.2
|
|
|
6bdabb |
BuildRequires: python%{python3_pkgversion}-wheel
|
|
|
6bdabb |
|
|
|
6bdabb |
Requires: python%{python3_pkgversion}-semantic_version >= 2.8.2
|
|
|
6bdabb |
Requires: python%{python3_pkgversion}-setuptools >= 62.4
|
|
|
6bdabb |
# RHEL: Dependency is missing
|
|
|
6bdabb |
#BuildRequires: python3dist(typing-extensions) >= 3.7.4.4
|
|
|
6bdabb |
%if 0%{?fedora}
|
|
|
6bdabb |
BuildRequires: rust-packaging >= 1.45
|
|
|
6bdabb |
%else
|
|
|
6bdabb |
# RHEL has rust-toolset
|
|
|
6bdabb |
BuildRequires: rust-toolset >= 1.45
|
|
|
6bdabb |
Requires: rust-toolset >= 1.45
|
|
|
6bdabb |
%endif
|
|
|
6bdabb |
%if %{with tests}
|
|
|
6bdabb |
BuildRequires: rust-pyo3+default-devel
|
|
|
6bdabb |
%endif
|
|
|
6bdabb |
|
|
|
6bdabb |
%description
|
|
|
6bdabb |
Setuptools helpers for Rust Python extensions. Compile and distribute Python
|
|
|
6bdabb |
extensions written in Rust as easily as if they were written in C.
|
|
|
6bdabb |
|
|
|
6bdabb |
|
|
|
6bdabb |
%prep
|
|
|
6bdabb |
%autosetup -n setuptools-rust-%{version}
|
|
|
6bdabb |
# Remove bundled egg-info
|
|
|
6bdabb |
rm -rf setuptools-rust.egg-info
|
|
|
6bdabb |
|
|
|
6bdabb |
%if ! 0%{?fedora}
|
|
|
6bdabb |
# remove dependency on typing extensions and use
|
|
|
6bdabb |
# stdlib instead
|
|
|
6bdabb |
sed -i 's/typing_extensions.*$//g' setup.cfg
|
|
|
6bdabb |
|
|
|
6bdabb |
sed -i -e 's/typing_extensions/typing/' \
|
|
|
6bdabb |
setuptools_rust/setuptools_ext.py \
|
|
|
6bdabb |
setuptools_rust/build.py \
|
|
|
6bdabb |
setuptools_rust/extension.py
|
|
|
6bdabb |
|
|
|
6bdabb |
%endif
|
|
|
6bdabb |
|
|
|
6bdabb |
|
|
|
6bdabb |
%build
|
|
|
6bdabb |
%py3_build
|
|
|
6bdabb |
|
|
|
6bdabb |
%install
|
|
|
6bdabb |
%py3_install
|
|
|
6bdabb |
|
|
|
6bdabb |
%check
|
|
|
6bdabb |
PYTHONPATH=%{buildroot}%{python3_sitelib} \
|
|
|
6bdabb |
%{__python3} -c "from setuptools_rust import RustExtension, version"
|
|
|
6bdabb |
|
|
|
6bdabb |
%if %{with tests}
|
|
|
6bdabb |
cd examples/hello-world
|
|
|
6bdabb |
%cargo_prep
|
|
|
6bdabb |
PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} setup.py build
|
|
|
6bdabb |
cd ../..
|
|
|
6bdabb |
%endif
|
|
|
6bdabb |
|
|
|
6bdabb |
|
|
|
6bdabb |
%files -n python%{python3_pkgversion}-setuptools-rust
|
|
|
6bdabb |
%doc README.md CHANGELOG.md
|
|
|
6bdabb |
%license LICENSE
|
|
|
6bdabb |
%{python3_sitelib}/setuptools_rust/
|
|
|
6bdabb |
%{python3_sitelib}/setuptools_rust-%{version}-py%{python3_version}.egg-info/
|
|
|
6bdabb |
|
|
|
6bdabb |
%changelog
|
|
|
6bdabb |
* Thu Nov 03 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.5.2-1
|
|
|
6bdabb |
- Initial import
|
|
|
6bdabb |
- Fedora contributions by:
|
|
|
6bdabb |
Christian Heimes <cheimes@redhat.com>
|
|
|
6bdabb |
Gwyn Ciesla <limb@fedoraproject.org>
|
|
|
6bdabb |
Tomáš Hrnčiar <thrnciar@redhat.com>
|