# lightning-utilities -- small helpers shared by the Lightning AI projects: # RequirementCache/module_available (optional-dependency probing), apply_to_collection, # rank-zero logging and a StrEnum. Pure Python. # # WHY IT IS HERE: it is the one missing runtime dependency of torchmetrics, which is # the one missing runtime dependency of DeepInverse (imaging inverse problems: # MRI/CT reconstruction with deep learning). # python-lightning-utilities -> python-torchmetrics -> python-deepinv # # Class 1 under docs/PACKAGING-POLICY.md: Fedora ships no package by this source # name and nothing provides python3dist(lightning-utilities). Verified 2026-10-11: # dnf repoquery --whatprovides 'python3dist(lightning-utilities)' -> empty # Runtime deps (packaging>=22, typing_extensions) come from Fedora proper. %global pypi_name lightning-utilities %global import_name lightning_utilities Name: python-%{pypi_name} Version: 0.15.3 Release: 1%{?dist} Summary: Common Python utilities and GitHub Actions helpers of Lightning AI License: Apache-2.0 URL: https://github.com/Lightning-AI/utilities # The GitHub tag, not the PyPI sdist: the sdist ships no tests/, and %%check runs # upstream's unit tests. src/ is byte-identical between the two (diff -rq, the # only difference is the sdist's generated egg-info). Source0: %{url}/archive/v%{version}/utilities-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest) %global _description %{expand: Lightning Utilities collects the small helpers that PyTorch Lightning, torchmetrics and the other Lightning AI projects share: RequirementCache and module_available for probing optional dependencies with a readable install hint, apply_to_collection for mapping a function over nested containers of tensors, rank-zero-only logging for distributed jobs, and a string Enum.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # The docs helper module needs requests (upstream's "docs" extra). Fedora ships # it; Recommends so lightning_utilities.docs works on a default install without # making it a hard dependency of torchmetrics users. Recommends: python3-requests %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n utilities-%{version} %generate_buildrequires # Core requirements only. The cli extra (jsonargparse, fire) and docs extra are # for upstream's own CI tooling, not for torchmetrics. %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{import_name} %check # lightning_utilities.docs imports requests at module scope; it is the Sphinx # helper used to build Lightning's own documentation (upstream puts requests in # the "docs" extra, not in core). Neither torchmetrics nor deepinv imports it: # their only uses are core.enums, core.imports and apply_to_collection. %pyproject_check_import -e 'lightning_utilities.docs*' # Upstream's unit tests, against the installed tree. pyproject's addopts # (--doctest-modules, --durations, --color) are upstream CI settings; -c # /dev/null drops them so the run is just the tests. # - tests/unittests/docs: needs upstream's docs/source tree, absent from the tag # archive's installable part and irrelevant to the runtime package. # - tests/unittests/cli: drives the optional cli extra (jsonargparse/fire), # which is not packaged here. %pytest -c /dev/null --rootdir=tests tests/unittests \ --ignore=tests/unittests/docs \ --ignore=tests/unittests/cli \ -p no:cacheprovider -v %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md CHANGELOG.md %changelog * Sun Oct 11 2026 Morgan Hough - 0.15.3-1 - Initial package: the bottom of lightning-utilities -> torchmetrics -> deepinv.