%global pkgvers 0 %global scdate0 20240508 %global schash0 ab958d42e44cad2e0517907278d55ca7432ea32c %global branch0 master %global source0 https://github.com/optuna/optuna.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: python-optuna Version: 3.6.1 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Optuna: A hyperparameter optimization framework License: MIT BuildArch: noarch URL: https://optuna.org BuildRequires: git python3-devel python3-setuptools python3-wheel python3-pip %description Optuna is an automatic hyperparameter optimization software framework, particularly designed for machine learning. %package -n python3-optuna Summary: %{summary} Provides: python-optuna %description -n python3-optuna Optuna is an automatic hyperparameter optimization software framework, particularly designed for 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 log --format=fuller %build %if 0%{?fedora} > 36 %pyproject_wheel %else echo "import setuptools; setuptools.setup(packages=setuptools.find_packages(),name='optuna',version='%{version}')" > setup.py %{__python3} setup.py build %endif %install %if 0%{?fedora} > 36 %pyproject_install %else %{__python3} setup.py install --root %{buildroot} --install-lib=%{python3_sitelib} %endif # cleanup rm -rf %{buildroot}%{python3_sitelib}/tests || true rm -rf %{buildroot}%{python3_sitelib}/benchmarks || true %if 0%{?rhel} == 8 find %{buildroot} -name '*.py' -exec sed -i '/import annotations/d' {} + %endif %files -n python3-optuna %license LICENSE %doc README.md %if 0%{?fedora} > 36 %{_bindir}/* %endif %{python3_sitelib}/optuna/ %{python3_sitelib}/optuna-*.*-info/ %changelog * Fri Mar 29 2019 Balint Cristian - github upstream releases