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

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