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

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