%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 # bidsschematools ~= 1.0, but rawhide has 2.0.0. dandi calls one function, # bidsschematools.validator.validate_bids(paths, exclude_files=...), and reads bids_version, # path_tracking, schema_tracking and match_listing from its result; 2.0.0 keeps all of them. # %%check runs a real BIDS validation through dandi on whichever version is installed. sed -i 's/^ "bidsschematools ~= 1.0",$/ "bidsschematools >= 1.0, < 3",/' pyproject.toml grep -q '"bidsschematools >= 1.0, < 3"' pyproject.toml %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"))) # BIDS validation through bidsschematools (the relaxed cap): a valid minimal dataset gives # no errors for its valid file, and a misnamed file is reported. import json, bidsschematools from dandi.validate._core import validate_bids b = Path(tempfile.mkdtemp(), "bids") (b / "sub-01" / "anat").mkdir(parents=True) (b / "dataset_description.json").write_text(json.dumps({"Name": "t", "BIDSVersion": "1.9.0"})) (b / "sub-01" / "anat" / "sub-01_T1w.nii.gz").write_bytes(b"") (b / "sub-01" / "anat" / "sub-01_notasuffix.nii.gz").write_bytes(b"") res = validate_bids(b) txt = [f"{getattr(r, 'path', '')} {r.message}" for r in res] print("bidsschematools", bidsschematools.__version__, "->", len(res), "results") for t in txt: print(" ", t[:160]) assert any("notasuffix" in t for t in txt), txt 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); the deno BIDS validator and Zarr v3 validation report it missing. bidsschematools cap relaxed to < 3 (rawhide has 2.0.0, same API); %%check validates a small BIDS dataset with it.