%global pypi_name dandi Name: python-%{pypi_name} Version: 0.81.0 Release: 1%{?dist} Summary: Command-line client and Python library for the DANDI Archive License: Apache-2.0 URL: https://github.com/dandi/dandi-cli Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: dandi is the command-line client and Python library for the DANDI Archive (dandiarchive.org), the BRAIN Initiative archive for cellular neurophysiology and neuroimaging data in NWB, BIDS and OME-Zarr. It downloads Dandisets and assets, organizes NWB files into the DANDI layout, validates metadata, and uploads. Not available in this build: two optional validators that Fedora can't provide. BIDS validation (bids-validator-deno, a Deno-compiled binary) and Zarr format 3 validation (tensorstore, a Bazel-built C++ library) report that the validator is missing; every other command works. Either can be added with pip install --user if needed.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n %{pypi_name}-%{version} # See the description: neither has a Fedora build. dandi imports tensorstore only inside # its Zarr v3 validator (dandi/files/zarr.py) and runs bids-validator-deno as an external # command (dandi/bids_validator_deno/), so dropping them from the requirements leaves # everything else working; %%check proves the CLI and the zarr v2 path. sed -i -E '/^ "(bids-validator-deno|tensorstore) >= [0-9.]+",$/d' pyproject.toml if grep -qE '"(bids-validator-deno|tensorstore)' pyproject.toml; then exit 1; fi %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check export HOME=$PWD # No etelemetry version check against the network during the build. export DANDI_NO_ET=1 %pyproject_check_import -e '%{pypi_name}.tests*' -e '%{pypi_name}.*.tests*' -e '%{pypi_name}.pytest_plugin' %{py3_test_envvars} %{buildroot}%{_bindir}/dandi --version %{py3_test_envvars} %{buildroot}%{_bindir}/dandi --help > /dev/null # Offline: parse archive URLs, and checksum a local Zarr v2 store the way upload does # (zarr_checksum), so the dropped tensorstore isn't on the path dandi actually uses. %{py3_test_envvars} %{python3} - <<'EOF' from dandi.dandiarchive import parse_dandi_url u = parse_dandi_url("DANDI:000027/0.210831.2033") assert u.dandiset_id == "000027", u import numpy as np, zarr, tempfile, os from dandi.support.digests import get_zarr_checksum from pathlib import Path d = tempfile.mkdtemp() z = zarr.open(os.path.join(d, "x.zarr"), mode="w", shape=(4, 4), chunks=(2, 2), dtype="i4") z[:] = np.arange(16).reshape(4, 4) print("zarr checksum", get_zarr_checksum(Path(d, "x.zarr"))) EOF %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md CHANGELOG.md %{_bindir}/dandi %changelog * Mon Oct 12 2026 Morgan Hough - 0.81.0-1 - Initial package. Without bids-validator-deno and tensorstore (no Fedora builds possible); BIDS and Zarr v3 validation report the validator missing.