%global pypi_name unigradicon Name: python-unigradicon Version: 1.0.5 Release: 1%{?dist} Summary: Foundation model for medical image registration # The LICENSE file is the full Apache License 2.0 text, but setup.cfg carries a # "License :: OSI Approved :: MIT License" classifier and PyPI reports no licence # at all. The file is the grant; the classifier is a stale label. Read from the # file, as house practice requires, not from the index. License: Apache-2.0 URL: https://github.com/uncbiag/uniGradICON # NOT %%{pypi_source}: 1.0.5 publishes a wheel only on PyPI, no sdist, and # Fedora builds from source. The GitHub tag is "1.0.5" (no "v" prefix, unlike # v1.0.3 and v1.0.4) and setup.cfg in that tag reads version = 1.0.5. Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros # Needed for %%check -- see the Requires below for why none of these are # generated from upstream's metadata. BuildRequires: python3-itk BuildRequires: python3-footsteps BuildRequires: python3-torch %global _description %{expand: uniGradICON is a pretrained deep-learning model for registering medical images of any anatomy, built on the GradICON/ICON inverse-consistency framework. It provides the unigradicon-register, unigradicon-warp, unigradicon-jacobian and unicarl-register commands. Model weights are NOT included. They are downloaded from GitHub releases on first use, so the first registration needs network access. The import name is "unigradicon".} %description %{_description} %package -n python3-unigradicon Summary: %{summary} # Upstream declares only icon_registration. The code also imports itk, footsteps # and torch directly at module scope, none of which are in install_requires, so # nothing is generated for them. python3-itk cannot be generated in any case: it # provides no python3dist(itk) (a gap in the ITK spec). Requires: python3-itk Requires: python3-footsteps Requires: python3-torch %description -n python3-unigradicon %{_description} %prep %autosetup -n uniGradICON-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files unigradicon %check # Import only; the tests download weights. unigradicon.unicarl is excluded # because it imports icon_registration.unicarl.register, which imports # torchvision -- BROKEN in Fedora on f45 and rawhide (see # docs/upstream/fedora-torchvision-cuda-version.md). It will import once Fedora # fixes torchvision, with no change here. %pyproject_check_import -e unigradicon.unicarl %files -n python3-unigradicon -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/unigradicon-register %{_bindir}/unigradicon-warp %{_bindir}/unigradicon-jacobian %{_bindir}/unicarl-register %changelog * Sun Oct 04 2026 Morgan Hough - 1.0.5-1 - Initial package: unigradicon 1.0.5, a dependency of Project-MONAI/monai-physio. Its only declared dependency is icon-registration, packaged in 1.1.8-1. - Built from the GitHub tag, not PyPI: 1.0.5 is wheel-only there. The tag is "1.0.5" and its setup.cfg agrees (main used to read 1.0.4). - LICENSE is the full Apache-2.0 text; the MIT classifier in setup.cfg disagrees and is treated as a stale label. - Undeclared upstream dependencies added by hand: itk, footsteps and torch are all imported at module scope but absent from install_requires. - unigradicon.unicarl excluded from the import check: it needs torchvision, which is broken in Fedora on f45/rawhide. - Model weights are fetched from GitHub releases at first use, not shipped.