%global pkgvers 0 %global scdate0 20250908 %global schash0 a08ba9d86374d6517ff34886241b5e8e0c71bd36 %global branch0 main %global source0 https://github.com/jax-ml/ml_dtypes.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: python-ml_dtypes Version: %(curl -s https://raw.githubusercontent.com/jax-ml/ml_dtypes/%{schash0}/ml_dtypes/__init__.py | grep __version__ | sed 's|[^[:digit:].]||g') Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: NumPy dtype extensions used in machine learning. License: Apache 2.0 URL: https://github.com/jax-ml/ml_dtypes BuildRequires: git python3-devel python3-setuptools python3-pip BuildRequires: gcc-c++ python3-numpy python3-pybind11 pybind11-devel BuildRequires: eigen3-devel %if 0%{?rhel} == 10 BuildRequires: pyproject-rpm-macros %endif %description A stand-alone implementation of several NumPy dtype extensions used in machine learning. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git submodule update --init --depth 1 third_party/eigen git log --format=fuller # requirements sed -i 's|"numpy~=.*"|"numpy"|' pyproject.toml sed -i 's|"setuptools~=.*"|"setuptools"|' pyproject.toml # fc42 license %if 0%{?fedora} == 42 sed -i '/license/d' pyproject.toml %endif %generate_buildrequires %build %global optflags %(echo "%{optflags} -fpermissive") %pyproject_wheel %install %pyproject_install # deps sed -i 's|Requires-Dist: ||g' %{buildroot}%{python3_sitearch}/*.dist-info/METADATA sed -i 's|Provides-Extra: ||g' %{buildroot}%{python3_sitearch}/*.dist-info/METADATA # clean rm -rf %{buildroot}%{python3_sitearch}/third_party %files %license LICENSE %doc README.md %{python3_sitearch}/ml_dtypes %{python3_sitearch}/*.*-info %changelog * Tue Jun 06 2023 Cristian Balint - github release updates