%global pypi_name bids2table Name: python-%{pypi_name} Version: 2.3.1 Release: 3%{?dist} Summary: Index BIDS datasets into tables License: MIT URL: https://github.com/childmindresearch/bids2table Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: bids2table indexes a BIDS dataset (entities, sidecar metadata, file paths) into an Arrow/Parquet table, fast enough for datasets with millions of files. BIDS (the Brain Imaging Data Structure) is the standard layout for neuroimaging datasets used by OpenNeuro, fMRIPrep and most current pipelines.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n bids2table-%{version} # Fedora rejects ambiguous #!/usr/bin/env python shebangs in installed modules. grep -rlI '^#!/usr/bin/env python$' . | xargs -r sed -i '1s|^#!/usr/bin/env python$|#!%{python3}|' # Old versioneer.py uses configparser.SafeConfigParser and readfp, both removed in Python 3.12. if [ -f versioneer.py ] && grep -q SafeConfigParser versioneer.py; then sed -i 's/SafeConfigParser/ConfigParser/g; s/\.readfp(/.read_file(/g' versioneer.py if grep -qE 'SafeConfigParser|readfp\(' versioneer.py; then exit 1; fi fi # pyarrow>=24 and tqdm>=4.67.3 are the versions upstream happened to test with. pyarrow 23 # (F44, F45) passes %%check, which indexes a small BIDS dataset to Parquet and reads it back; # pyarrow 20 (F43) fails it (TypeError in indexing), so the floor is 23 and there's no F43 build. sed -i 's/"pyarrow>=24.0.0", "tqdm>=4.67.3"/"pyarrow>=23", "tqdm>=4"/' pyproject.toml grep -q '"pyarrow>=23", "tqdm>=4"' pyproject.toml %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_buildrequires %build export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %pyproject_wheel %install %pyproject_install # Build helpers some DataLad-template projects install at top level; not part of the package. rm -rf %{buildroot}%{python3_sitelib}/_datalad_buildsupport %{buildroot}%{python3_sitelib}/tools %{buildroot}%{python3_sitelib}/benchmarks %{buildroot}%{python3_sitelib}/tests %{buildroot}%{python3_sitelib}/tests.py # Old setup.py data_files can drop these at the top of site-packages (osfclient does). rm -f %{buildroot}%{python3_sitelib}/{LICENSE,VERSION,requirements.txt} %pyproject_save_files -L bids2table %check %pyproject_check_import -e 'bids2table.tests*' -e 'bids2table.*.tests*' -e '*.test_*' -e '*.conftest' -e '*.pytest_plugin' -e 'bids2table.pybids' %{py3_test_envvars} %{python3} - <<'EOF' import json, tempfile, pathlib root = pathlib.Path(tempfile.mkdtemp(), 'bids') for sub in ('01', '02'): d = root / f'sub-{sub}' / 'anat'; d.mkdir(parents=True) (d / f'sub-{sub}_T1w.nii.gz').write_bytes(b'') (d / f'sub-{sub}_T1w.json').write_text(json.dumps({'RepetitionTime': 2.3, 'EchoTime': 0.003, 'FlipAngle': 9})) (root / 'dataset_description.json').write_text(json.dumps({'Name': 't', 'BIDSVersion': '1.9.0'})) import bids2table as b2t, pyarrow as pa, pyarrow.parquet as pq tab = b2t.index_dataset(root) out = root.parent / 'index.parquet' pq.write_table(tab, out) back = pq.read_table(out) print('bids2table: pyarrow', pa.__version__, back.num_rows, 'rows', back.column_names[:6]) assert back.num_rows >= 2, back.num_rows EOF %{py3_test_envvars} %{buildroot}%{_bindir}/b2t2 --help > /dev/null %{py3_test_envvars} %{buildroot}%{_bindir}/bids2table --help > /dev/null %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %{_bindir}/b2t2 %{_bindir}/bids2table %changelog * Mon Oct 12 2026 Morgan Hough - 2.3.1-3 - pyarrow floor is 23, not 20: F43's pyarrow 20 fails the indexing check. No F43 build. * Mon Oct 12 2026 Morgan Hough - 2.3.1-2 - Relax the pyarrow/tqdm floors; %%check indexes a BIDS dataset to Parquet. * Mon Oct 12 2026 Morgan Hough - 2.3.1-1 - Initial package, for the DataLad extension stack and dandi.