%global pypi_name idc-index %global mod_name idc_index Name: python-%{pypi_name} Version: 0.13.0 Release: 1%{?dist} Summary: Query and download data from the NCI Imaging Data Commons License: MIT URL: https://github.com/ImagingDataCommons/idc-index Source0: %{pypi_source %{mod_name} %{version}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: s5cmd %global _description %{expand: idc-index is the Python client for the NCI Imaging Data Commons (IDC), a cloud repository of openly available cancer imaging data in DICOM. It queries the IDC index with SQL (through DuckDB), selects collections, patients, studies or series, and downloads them from the public AWS or Google Cloud buckets with s5cmd. It also provides the "idc" command-line tool, and it is what 3D Slicer's IDC Browser extension uses.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # idc-index runs s5cmd for every download, found on PATH first # (index.py: shutil.which("s5cmd")). Upstream depends on the PyPI "s5cmd" # wheel, which only bundles that same Go binary; the system one replaces it. Requires: s5cmd %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{mod_name}-%{version} # Drop the PyPI s5cmd wrapper from the metadata (Requires: s5cmd above instead). sed -i -e '/"s5cmd>=0.3.2",/d' pyproject.toml ! grep -n '"s5cmd' pyproject.toml %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel %install %pyproject_install %pyproject_save_files %{mod_name} %check %pyproject_check_import export HOME=$PWD/_home # The client resolves the system s5cmd, not a bundled one. %{py3_test_envvars} %{python3} -c 'from idc_index import IDCClient; c = IDCClient(); print(c.s5cmdPath); assert c.s5cmdPath == "/usr/bin/s5cmd", c.s5cmdPath' # Upstream's tests that query the bundled index offline. The rest download # from IDC, fetch extra indices, or list bucket contents and index URLs with # s5cmd/requests over the network (test_indices_urls, test_*_file_URLs), which # the build has none of; they run in tests/idc.bats against the installed stack. %pytest -v tests/idcindex.py -k "%{shrink: test_get_collections or test_get_idc_version or test_get_patients or test_get_studies or test_get_series or test_sql_queries or test_singleton_attribute or test_list_indices or test_exception_attributes or test_exception_custom_message}" %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/idc %changelog * Sun Oct 11 2026 Morgan Hough - 0.13.0-1 - Initial package, for 3D Slicer's IDC Browser extension