Blame SPECS/python3.11-setuptools-rust.spec

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