%global pypi_name dynamic-network-architectures %global dist_name dynamic_network_architectures %global import_name dynamic_network_architectures Name: python-%{pypi_name} Version: 0.4.4 Release: 3%{?dist} Summary: Dynamically configurable network architectures for medical segmentation License: Apache-2.0 URL: https://github.com/MIC-DKFZ/dynamic-network-architectures Source0: %{pypi_source %{dist_name}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %global _description %{expand: A library of torch network architectures whose topology is built at runtime from a configuration rather than hard-coded: encoders, decoders, residual and convolutional U-Nets, plus transformer based designs (EVA, Primus, DINOv2). nnU-Net uses it to instantiate the architecture chosen by its dataset fingerprint, which is why the network shape can adapt per dataset.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # Upstream caps timm<1.0.23 because 1.0.23 broke 3D RotaryEmbeddingCat, which # Primus builds on (MIC-DKFZ/dynamic-network-architectures#20). Our python-timm # 1.0.29-6 carries the one-line fix (docs/upstream/timm-rope-cat-rank-regression.md), # so the cap is dropped in %%prep and replaced by a floor on the patched build. Requires: python3-timm >= 1.0.29-6 %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{dist_name}-%{version} sed -i 's/"timm<1.0.23"/"timm"/' pyproject.toml grep -q '"timm"' pyproject.toml %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{import_name} %check # Importing this package imports timm, which imports Fedora's python3-torchvision, # and that cannot import on f45 and later ('_OpNamespace' 'torchvision' object has # no attribute '_cuda_version'; 11014288). Same gate and same revert condition as # python-timm.spec: docs/upstream/fedora-torchvision-cuda-version.md. %if 0%{?fedora} >= 45 test -d %{buildroot}%{python3_sitelib}/%{import_name} %{python3} -m compileall -q %{buildroot}%{python3_sitelib}/%{import_name} > /dev/null echo "NOTE: import check skipped on f45+ until Fedora's torchvision imports again" %else %pyproject_check_import %endif %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Mon Sep 21 2026 Morgan Hough - 0.4.4-3 - Skip the import check on f45 and later, where Fedora's torchvision cannot be imported (same gate as python-timm); byte-compile the tree instead. * Mon Sep 21 2026 Morgan Hough - 0.4.4-2 - Drop upstream's timm<1.0.23 cap and require python3-timm >= 1.0.29-6, which carries the RotaryEmbeddingCat rank fix the cap was working around. * Sat Jul 18 2026 Morgan Hough - 0.4.4-1 - Initial package. Architecture library of nnU-Net v2, part of the nnInteractive dependency chain.