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

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