From 9fe3d25253f7cb891eb5ec6d7fac54f002a407d6 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 16 May 2023 06:24:31 +0000 Subject: [PATCH] import python3.11-setuptools-rust-1.5.2-1.el8 --- .gitignore | 1 + .python3.11-setuptools-rust.metadata | 1 + SPECS/python3.11-setuptools-rust.spec | 95 +++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 .gitignore create mode 100644 .python3.11-setuptools-rust.metadata create mode 100644 SPECS/python3.11-setuptools-rust.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a2ada4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/setuptools-rust-1.5.2.tar.gz diff --git a/.python3.11-setuptools-rust.metadata b/.python3.11-setuptools-rust.metadata new file mode 100644 index 0000000..c5de5fc --- /dev/null +++ b/.python3.11-setuptools-rust.metadata @@ -0,0 +1 @@ +16a89bb5ffd447c0823a6ee879f8b948dfe63614 SOURCES/setuptools-rust-1.5.2.tar.gz diff --git a/SPECS/python3.11-setuptools-rust.spec b/SPECS/python3.11-setuptools-rust.spec new file mode 100644 index 0000000..34a6e70 --- /dev/null +++ b/SPECS/python3.11-setuptools-rust.spec @@ -0,0 +1,95 @@ +%global __python3 /usr/bin/python3.11 +%global python3_pkgversion 3.11 + +%if 0%{?rhel} +%bcond_with tests +%else +%bcond_without tests +%endif + +Name: python%{python3_pkgversion}-setuptools-rust +Version: 1.5.2 +Release: 1%{?dist} +Summary: Setuptools Rust extension plugin + +License: MIT +URL: https://github.com/PyO3/setuptools-rust +Source0: %{pypi_source setuptools-rust} +BuildArch: noarch +ExclusiveArch: %{rust_arches} + +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-rpm-macros +BuildRequires: python%{python3_pkgversion}-setuptools > 46.1 +BuildRequires: python%{python3_pkgversion}-semantic_version >= 2.8.2 +BuildRequires: python%{python3_pkgversion}-wheel + +Requires: python%{python3_pkgversion}-semantic_version >= 2.8.2 +Requires: python%{python3_pkgversion}-setuptools >= 62.4 +# RHEL: Dependency is missing +#BuildRequires: python3dist(typing-extensions) >= 3.7.4.4 +%if 0%{?fedora} +BuildRequires: rust-packaging >= 1.45 +%else +# RHEL has rust-toolset +BuildRequires: rust-toolset >= 1.45 +Requires: rust-toolset >= 1.45 +%endif +%if %{with tests} +BuildRequires: rust-pyo3+default-devel +%endif + +%description +Setuptools helpers for Rust Python extensions. Compile and distribute Python +extensions written in Rust as easily as if they were written in C. + + +%prep +%autosetup -n setuptools-rust-%{version} +# Remove bundled egg-info +rm -rf setuptools-rust.egg-info + +%if ! 0%{?fedora} +# remove dependency on typing extensions and use +# stdlib instead +sed -i 's/typing_extensions.*$//g' setup.cfg + +sed -i -e 's/typing_extensions/typing/' \ + setuptools_rust/setuptools_ext.py \ + setuptools_rust/build.py \ + setuptools_rust/extension.py + +%endif + + +%build +%py3_build + +%install +%py3_install + +%check +PYTHONPATH=%{buildroot}%{python3_sitelib} \ + %{__python3} -c "from setuptools_rust import RustExtension, version" + +%if %{with tests} +cd examples/hello-world +%cargo_prep +PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} setup.py build +cd ../.. +%endif + + +%files -n python%{python3_pkgversion}-setuptools-rust +%doc README.md CHANGELOG.md +%license LICENSE +%{python3_sitelib}/setuptools_rust/ +%{python3_sitelib}/setuptools_rust-%{version}-py%{python3_version}.egg-info/ + +%changelog +* Thu Nov 03 2022 Charalampos Stratakis - 1.5.2-1 +- Initial import +- Fedora contributions by: + Christian Heimes + Gwyn Ciesla + Tomáš Hrnčiar