%global pypi_name torchrl %global pypi_version 0.3.1 # torch toolchain %global toolchain gcc %global desc %{expand: \ TorchRL is an open-source Reinforcement Learning (RL) library for PyTorch. It provides PyTorch and python-first, low and high level abstractions for RL that are intended to be efficient, modular, documented and properly tested. The code is aimed at supporting research in RL. Most of it is written in python in a highly modular way, such that researchers can easily swap components, transform them or write new ones with little effort.} Name: python-%{pypi_name} Version: %{pypi_version} Release: %autorelease Summary: A PyTorch library for Reinforcement Learning License: MIT URL: https://github.com/pytorch/rl Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/rl-v%{version}.tar.gz # Limit to these because that is what torch is on ExclusiveArch: x86_64 aarch64 BuildRequires: gcc-c++ BuildRequires: ninja-build BuildRequires: python3-devel BuildRequires: python3-torch BuildRequires: python3dist(setuptools) Requires: python3dist(torch) Requires: python3dist(tensordict) %description %{desc} %package -n python3-%{pypi_name} Summary: A PyTorch library for Reinforcement Learning %description -n python3-%{pypi_name} %{desc} %prep %autosetup -p1 -n rl-%{version} %build # Building uses python3_sitearch/torch/utils/cpp_extension.py # cpp_extension.py does a general linking with all the pytorch libs which # leads warnings being reported by rpmlint. # # depends on python3dist(ninja) which does not exist # so dropping back to py3 %py3_build %if %{with test} %check %pytest %endif %install %py3_install # rm build_tools rm -rf %{buildroot}%{python3_sitearch}/build_tools %files -n python3-%{pypi_name} %license LICENSE %doc README.md %{python3_sitearch}/%{pypi_name} %{python3_sitearch}/%{pypi_name}-%{pypi_version}*.egg-info %changelog %autochangelog