%global pypi_name dcm2bids Name: python-%{pypi_name} Version: 3.3.1 Release: 1%{?dist} Summary: Reorganize NIfTI files from dcm2niix into BIDS License: GPL-3.0-or-later URL: https://github.com/UNFmontreal/Dcm2Bids Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: Dcm2Bids converts DICOM to NIfTI with dcm2niix and reorganizes the result into a BIDS dataset according to a JSON configuration file that matches series by their sidecar metadata. 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} Requires: dcm2niix %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n dcm2bids-%{version} # Fedora rejects ambiguous #!/usr/bin/env python shebangs in installed modules. find . -name '*.py' -exec 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 %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 dcm2bids %check %pyproject_check_import -e 'dcm2bids.tests*' -e 'dcm2bids.*.tests*' -e '*.test_*' -e '*.conftest' -e '*.pytest_plugin' %{py3_test_envvars} %{buildroot}%{_bindir}/dcm2bids --help > /dev/null %{py3_test_envvars} %{buildroot}%{_bindir}/dcm2bids_helper --help > /dev/null %{py3_test_envvars} %{buildroot}%{_bindir}/dcm2bids_scaffold --help > /dev/null %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE.txt %{_bindir}/dcm2bids %{_bindir}/dcm2bids_helper %{_bindir}/dcm2bids_scaffold %changelog * Mon Oct 12 2026 Morgan Hough - 3.3.1-1 - Initial package, for the DataLad extension stack and dandi.