%global pypi_name einops %global pypi_version 0.8.1 Name: python-%{pypi_name} Version: %{pypi_version} # 0.1, deliberately below any Fedora release: this COPR build exists only because # Fedora ships einops for x86_64 alone. If Fedora re-enables aarch64, its build # supersedes this one automatically. Explicit, not %%autorelease -- that macro is # inert in this COPR (ci/PROCEDURES.md golden rule 3). Release: 0.2%{?dist} Summary: Deep learning operations reinvented License: MIT URL: https://github.com/arogozhnikov/einops Source0: %{url}/archive/v%{version}.tar.gz#/%{pypi_name}-%{pypi_version}.tar.gz BuildArch: noarch # Fedora's python-einops is ExclusiveArch: x86_64, with the comment # "Pytorch only on X86_64 and aarch64 / Fail to build 1/31/26" and the aarch64 # line commented out -- i.e. a parked build failure, not a real limitation. # PyTorch does ship for aarch64 (%%pt_arches = x86_64 aarch64; python3-torch # 2.9.1 is in f44 aarch64). The nnU-Net chain (nnunetv2, nninteractive, # dynamic-network-architectures) needs einops on aarch64. ExclusiveArch: x86_64 aarch64 BuildRequires: python3-devel BuildRequires: python3dist(numpy) BuildRequires: python3dist(torch) # pytest is NOT optional here: %%pyproject_check_import imports every shipped module, # including einops.tests, which imports pytest at module level. Dropping it in 0.1 # failed the aarch64 build with ModuleNotFoundError: No module named 'pytest'. BuildRequires: python3dist(pytest) # Fedora's spec also pulls jupyterlab, notebook, ipython, ipywidgets, ipykernel, # jupyter-console, nbformat, nbconvert and pillow -- all for the test # suite, which Fedora itself has disabled (its %%pytest lines are commented out). # Dropped here: they bring nothing while the tests are off, and a large # test-only dependency set is the likeliest source of the parked aarch64 failure. %description Flexible and powerful tensor operations for readable and reliable code. Supports numpy, pytorch, tensorflow, jax, and others. %package -n python3-%{pypi_name} Summary: Deep learning operations reinvented %description -n python3-%{pypi_name} Flexible and powerful tensor operations for readable and reliable code. Supports numpy, pytorch, tensorflow, jax, and others. %prep %autosetup -n %{pypi_name}-%{pypi_version} rm -rf %{pypi_name}.egg-info # Remove framework layers Fedora cannot provide, so the import check does not # trip on them (same set Fedora removes). rm einops/layers/flax.py rm einops/layers/keras.py rm einops/layers/oneflow.py rm einops/layers/paddle.py rm einops/layers/tensorflow.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check # Import checks against both backends the chain actually uses. Mirrors Fedora, # which runs only these (its pytest invocations are disabled). export EINOPS_TEST_BACKENDS=numpy %pyproject_check_import export EINOPS_TEST_BACKENDS=torch %pyproject_check_import %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md %changelog * Sat Sep 12 2026 Morgan Hough - 0.8.1-0.2 - Restore BuildRequires: python3dist(pytest). 0.1 dropped it along with the genuinely test-only deps, but %%pyproject_check_import imports every shipped module including einops.tests, which imports pytest -- so the aarch64 build (COPR 10980317) failed with ModuleNotFoundError: No module named 'pytest'. Fedora kept it for exactly this reason; the Jupyter set stays dropped. * Sat Sep 12 2026 Morgan Hough - 0.8.1-0.1 - COPR build for aarch64, where Fedora's python-einops is ExclusiveArch x86_64 after a parked "Fail to build 1/31/26". Needed by the nnU-Net chain. - Derived from Fedora's f44 spec: same version, same removed framework layers, same import-only %%check. Test-only BuildRequires dropped, since the tests are disabled upstream in Fedora too.