%global pypi_name idc-index-data %global mod_name idc_index_data Name: python-%{pypi_name} Version: 25.0.0 Release: 1%{?dist} Summary: Imaging Data Commons index used to query and download data # Code and the bundled index are both MIT. The index is metadata about the # Imaging Data Commons collections (identifiers, modalities, sizes, storage # URLs and each collection's own licence), not image data. License: MIT URL: https://github.com/ImagingDataCommons/idc-index-data Source0: %{pypi_source %{mod_name} %{version}} # The package finds its Parquet files through the wheel's RECORD file # (importlib.metadata distribution().files), and Fedora's %%pyproject_install # deletes RECORD, so files is None and the import itself fails. Fall back to # the package directory. Upstream draft: docs/upstream/idc-index-data-lookup-without-record.md Patch0: python-idc-index-data-lookup-without-record.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-pandas BuildRequires: python3-pyarrow BuildRequires: python3-requests %description idc-index-data packages the index of the NCI Imaging Data Commons (IDC) as Parquet files: one row per DICOM series with its collection, patient, study, modality, size and storage location. The idc-index client queries it to find and download public imaging data. %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} idc-index-data packages the index of the NCI Imaging Data Commons (IDC) as Parquet files. The idc-index client queries it to find and download public imaging data. %prep %autosetup -n %{mod_name}-%{version} -p1 # The build hook regenerates the index from Google BigQuery, but only when # GCP_PROJECT is set; without it, it ships the Parquet files the sdist already # carries. Drop the BigQuery/GCS client libraries from the build requirements # (none is packaged in Fedora) so pyproject_buildrequires does not ask for them. sed -i -e '/"db-dtypes",/d' -e '/"google-cloud-bigquery",/d' -e '/"google-cloud-storage",/d' pyproject.toml ! grep -n -e '"google-cloud' -e '"db-dtypes' pyproject.toml # Version comes from git (hatch-vcs); the sdist has no .git. test -f src/%{mod_name}/_version.py %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires %build unset GCP_PROJECT export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel %install %pyproject_install %pyproject_save_files %{mod_name} %check %pyproject_check_import # Upstream's package tests check the index files are bundled, readable and # consistent with the shipped metadata. No network. The other test files cover # the maintainers' index-generation scripts (scripts/), which are not shipped. %pytest -v tests/test_package.py %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Sun Oct 11 2026 Morgan Hough - 25.0.0-1 - Initial package, for the Imaging Data Commons client (idc-index)