%global python3_pkgversion 3.11 Name: python-ndindex Version: 1.7 Release: 2.ac14.py3.11%{?dist} Summary: Python library for manipulating indices of ndarrays # Upstream specified license as MIT and this covers almost all source files. # ndindex-1.7/ndindex/_crt.py is BSD-3-Clause License: MIT AND BSD-3-Clause URL: https://quansight-labs.github.io/ndindex/ Source: https://github.com/quansight-labs/ndindex/archive/%{version}/%{name}-%{version}.tar.gz Patch: 0001-Use-configparser.ConfigParser-instead-of-SafeConfigP.patch Patch: 0002-setup.py-specify-cython-language_level.patch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: gcc # For tests: BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-hypothesis BuildRequires: python%{python3_pkgversion}-numpy ExcludeArch: %{ix86} %global _description %{expand: ndindex is a library that allows representing and manipulating objects that can be valid indices to numpy arrays, i.e., slices, integers, ellipses, None, integer and boolean arrays, and tuples thereof. The goals of the library are to provide a uniform API to manipulate these objects, match semantics of numpy's ndarray, and to provide useful transformation and manipulation functions on index objects.} %description %_description %package -n python%{python3_pkgversion}-ndindex Summary: %{summary} Requires: python%{python3_pkgversion}-numpy %description -n python%{python3_pkgversion}-ndindex %_description %prep %autosetup -p1 -n ndindex-%{version} # It wants to add coverage and flakes, which is not useful for us rm pytest.ini %build %py3_build %install %py3_install %check OPTIONS=( # This test is flaky --deselect=ndindex/tests/test_shapetools.py::test_iter_indices_matmul # https://github.com/Quansight-Labs/ndindex/issues/158 --deselect=ndindex/tests/test_ndindex.py::test_eq ) %pytest -v "${OPTIONS[@]}" for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-ndindex %license LICENSE %doc README.md %{python3_sitearch}/ndindex/ %{python3_sitearch}/ndindex-%{version}-py%{python3_version}.egg-info/ %changelog * Wed Apr 17 2024 Ding-Yi Chen - 1.7-2.ac14.py3.11 - Cut corner packaging