%global pypi_name keras # Pure-Python, architecture-independent package %global debug_package %{nil} Name: python-Keras Version: 3.12.0 Release: 1%{?dist} Summary: Multi-backend deep learning framework for humans License: Apache-2.0 URL: https://keras.io/ Source0: https://github.com/keras-team/keras/archive/refs/tags/v%{version}/keras-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pip BuildRequires: python3-setuptools BuildRequires: python3-wheel %description Keras is a multi-backend, high-level neural networks API written in Python. It is capable of running on top of TensorFlow, JAX, PyTorch, and other frameworks, and focuses on enabling fast experimentation. Read the documentation at: https://keras.io/ %package -n python3-Keras Summary: Multi-backend deep learning framework for humans Provides: python-Keras = %{version}-%{release} Provides: python3dist(keras) = %{version} Requires: python3-absl-py Requires: python3-numpy Requires: python3-rich Requires: python3-namex Requires: python3-h5py Requires: python3-optree Requires: python3-ml-dtypes Requires: python3-packaging %description -n python3-Keras Keras is a multi-backend, high-level neural networks API written in Python. It is capable of running on top of TensorFlow, JAX, PyTorch, and other frameworks, and focuses on enabling fast experimentation. Read the documentation at: https://keras.io/ %package help Summary: Development documents and examples for Keras Requires: python3-Keras = %{version}-%{release} Provides: python3-Keras-doc %description help Keras is a multi-backend, high-level neural networks API written in Python. This package provides the development guides and examples shipped with Keras. %prep %autosetup -n keras-%{version} # Upstream derives the version from a dynamic setuptools attr # (keras.src.version.__version__). Combined with the package-dir remapping # that attr cannot be resolved by the distribution setuptools, so pin the # version statically where it is already known. sed -i 's/^dynamic = \["version"\]$/version = "%{version}"/' pyproject.toml # Drop the upstream test modules from the released wheel, matching what the # upstream pip_build.py produces. find keras -name '*_test.py' -delete %build # Make sure the wheel/setuptools build backend is importable even when the # distribution ships them under a non-standard prefix (e.g. /usr/local), # which rpmbuild does not place on sys.path by default. for d in /usr/local/lib64/python*/site-packages /usr/local/lib/python*/site-packages; do [ -d "$d" ] && export PYTHONPATH="$d${PYTHONPATH:+:$PYTHONPATH}" done pip3 wheel --no-build-isolation --no-deps --wheel-dir %{_builddir}/wheels . %install mkdir -p %{buildroot}%{python3_sitelib} wheel=$(ls %{_builddir}/wheels/keras-%{version}-*.whl) %{__python3} -m zipfile -e "$wheel" %{buildroot}%{python3_sitelib} install -d -m755 %{buildroot}%{_pkgdocdir} for d in guides examples; do if [ -d "$d" ]; then cp -arf "$d" %{buildroot}%{_pkgdocdir}/; fi done %files -n python3-Keras %license LICENSE %{python3_sitelib}/keras/ %{python3_sitelib}/keras-%{version}*.dist-info/ %files help %license LICENSE %{_pkgdocdir} %changelog * Wed Dec 02 2026 Python_Bot - 3.12.0-1 - Upgrade to 3.12.0 (multi-backend Keras 3)