## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global _description %{expand: Read / write access to some common neuroimaging file formats This package provides read +/- write access to some common medical and neuroimaging file formats, including: ANALYZE (plain, SPM99, SPM2 and later), GIFTI, NIfTI1, NIfTI2, MINC1, MINC2, MGH and ECAT as well as Philips PAR/REC. We can read and write Freesurfer geometry, and read Freesurfer morphometry and annotation files. There is some very limited support for DICOM. NiBabel is the successor of PyNIfTI. The various image format classes give full or selective access to header (meta) information and access to the image data is made available via NumPy arrays. } Name: python-nibabel Version: 5.1.0 Release: %autorelease Summary: Python package to access a cacophony of neuro-imaging file formats License: MIT and PDDL-1.0 URL: http://nipy.org/nibabel/ Source0: https://github.com/nipy/nibabel/archive/%{version}/nibabel-%{version}.tar.gz # distutils has been removed from Python 3.12 # https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html # https://github.com/nipy/nibabel/issues/1240 Patch: distutils.patch BuildArch: noarch %description %_description %package -n python3-nibabel Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-looseversion BuildRequires: python3-pytest BuildRequires: python3-pytest-httpserver BuildRequires: help2man Recommends: python3-scipy Recommends: python3-pydicom # Bundles their own version of netcdf reader # that is different from Scipy version Provides: bundled(python%{python3_version}dist(netcdf)) %description -n python3-nibabel %_description %prep # warning: don't use -S git/git_am here, or hatchling/hatch-vcs generates a wrong version %autosetup -p1 -n nibabel-%{version} # delete shebangs from files that don't need it find nibabel/cmdline/ -name "*.py" -execdir sed -i '/^#!python/ d' '{}' \; # correct other shebangs # upstream uses #!python as a shebang, correct it find . -name "*.py" -execdir sed -i 's|^#!python|#!%{python3}|' '{}' \; # delete .gitignore files rm -fv nibabel/{tests/data/,}.gitignore %generate_buildrequires %pyproject_buildrequires -x dicom,minc2,spm %build %pyproject_wheel %install %pyproject_install %pyproject_save_files nibabel nisext for binary in "parrec2nii" "nib-conform" "nib-convert" "nib-diff" "nib-dicomfs" "nib-ls" "nib-nifti-dx" "nib-roi" "nib-stats" "nib-tck2trk" "nib-trk2tck" do echo "Generating man page for ${binary}" PATH="$PATH:%{buildroot}/%{_bindir}/" help2man --no-info --no-discard-stderr --output="${binary}.1" "${binary}" install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary}.1" done %check # TestCifti2ImageAPI.test_filenames fails due to setuptools-bundled distutils' # LooseVersion issue: https://github.com/pypa/distutils/issues/122 # This can be worked around by setting the environment variable to point # to distutils from Python's standard library instead. # export SETUPTOOLS_USE_DISTUTILS=stdlib # These three tests, completely unrelated to the two patches fail on application of patches. # They're for deprecation etc., so ignore them for the moment # Remember to include in the next release when patches are not used # # Failing tests when using Python 3.12, which no longer has distutils in the stdlib # test_from_file_url, test_write_mgh, test_filename_exts, test_big_offset_exts, test_load_save # TODO: enable these tests again next release. They worked before. %{pytest} -v -k "not test_unremoved_module and not test_unremoved_object and not test_unremoved_attr \ and not test_from_file_url and not test_write_mgh and not test_filename_exts \ and not test_big_offset_exts and not test_load_save" %files -n python3-nibabel -f %{pyproject_files} %{_bindir}/parrec2nii %{_bindir}/nib-conform %{_bindir}/nib-convert %{_bindir}/nib-diff %{_bindir}/nib-dicomfs %{_bindir}/nib-ls %{_bindir}/nib-nifti-dx %{_bindir}/nib-roi %{_bindir}/nib-stats %{_bindir}/nib-tck2trk %{_bindir}/nib-trk2tck %{_mandir}/man1/nib* %{_mandir}/man1/parrec2nii.* %changelog * Mon Jul 17 2023 Sandro - 5.1.0-3 - Apply patch for removed distutils (RHBZ#2220356) * Wed Jul 12 2023 Python Maint - 5.1.0-2 - Rebuilt for Python 3.12 * Mon May 01 2023 Ankur Sinha (Ankur Sinha Gmail) - 5.1.0-1 - feat: update to 5.1.0 (fixes rhbz#2184180) * Fri Feb 17 2023 Ankur Sinha (Ankur Sinha Gmail) - 5.0.1-1 - feat: update to 5.0.1 (fixes rhbz#2169211) * Mon Feb 06 2023 Miro Hrončok - 5.0.0-3 - Restore broken python provides - Fixes: rhbz#2167445 - Fixes: rhbz#2167446 - Fixes: rhbz#2167447 - Fixes: rhbz#2167448 - Fixes: rhbz#2167449 - Fixes: rhbz#2167450 * Mon Feb 06 2023 Ankur Sinha (Ankur Sinha Gmail) - 5.0.0-2 - fix: backport patch to 5.x * Thu Feb 02 2023 Ankur Sinha (Ankur Sinha Gmail) - 5.0.0-1 - feat: update to 5.0.0 (fixes rhbz#2094602) * Thu Feb 02 2023 Ankur Sinha (Ankur Sinha Gmail) - 4.0.2-1 - feat: update to 4.0.2 * Fri Jan 20 2023 Fedora Release Engineering - 3.2.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Fri Jul 22 2022 Fedora Release Engineering - 3.2.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jun 14 2022 Python Maint - 3.2.2-3 - Rebuilt for Python 3.11 * Mon Mar 07 2022 Karolina Surma - 3.2.2-2 - Use distutils from Python's standard library to run tests * Thu Feb 10 2022 Ankur Sinha (Ankur Sinha Gmail) - 3.2.2-1 - feat: update to 3.2.2 (fixes rhbz#2052120) * Fri Jan 21 2022 Fedora Release Engineering - 3.2.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 3.2.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 3.2.1-3 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 3.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sat Nov 28 2020 Ankur Sinha - 3.2.1-1 - Update to latest bugfix release * Sat Nov 28 2020 Ankur Sinha - 3.2.0-1 - Update to latest release * Wed Jul 29 2020 Fedora Release Engineering - 3.1.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Sat Jul 04 2020 Ankur Sinha - 3.1.1-1 - Update to 3.1.1 * Tue May 26 2020 Miro Hrončok - 3.1.0-2 - Rebuilt for Python 3.9 * Fri May 01 2020 Ankur Sinha - 3.1.0-1 - Update to 3.1.0 * Sat Feb 01 2020 Ankur Sinha - 3.0.1-1 - Update to new release - Add pytest BR * Thu Jan 30 2020 Fedora Release Engineering - 2.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Fri Oct 25 2019 Ankur Sinha - 2.5.1-1 - Update to 2.5.1 * Thu Oct 03 2019 Miro Hrončok - 2.5.0-3 - Rebuilt for Python 3.8.0rc1 (#1748018) * Mon Aug 19 2019 Miro Hrončok - 2.5.0-2 - Rebuilt for Python 3.8 * Sun Aug 04 2019 Ankur Sinha - 2.5.0-1 - Update to latest release---fixes broken test * Fri Jul 26 2019 Fedora Release Engineering - 2.4.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Wed Jul 10 2019 Ankur Sinha - 2.4.1-1 - Update to 2.4.1 * Sat Feb 16 2019 Ankur Sinha - 2.3.3-1 - Update to 2.3.3 * Sat Feb 02 2019 Fedora Release Engineering - 2.3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Wed Nov 07 2018 Ankur Sinha - 2.3.1-1 - Update to latest upstream release - Remove unneeded patch * Mon Aug 13 2018 Igor Gnatenko - 2.3.0-3 - Drop python2 subpackage * Sat Jul 14 2018 Fedora Release Engineering - 2.3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Fri Jun 22 2018 Ankur Sinha - 2.3.0-1 - Update to 2.3.0 - No build since tests fail, issue filed: https://github.com/nipy/nibabel/issues/579 * Tue Jun 19 2018 Miro Hrončok - 2.2.0-3 - Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 2.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Sun Nov 12 2017 Igor Gnatenko - 2.2.0-1 - Update to 2.2.0 * Thu Jul 27 2017 Fedora Release Engineering - 2.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Mar 11 2017 Igor Gnatenko - 2.1.0-1 - Update to 2.1.0 * Sat Feb 11 2017 Fedora Release Engineering - 2.0.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 2.0.2-4 - Rebuild for Python 3.6 * Tue Jul 19 2016 Fedora Release Engineering - 2.0.2-3 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Feb 04 2016 Fedora Release Engineering - 2.0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Mon Nov 23 2015 Igor Gnatenko - 2.0.2-1 - Update to 2.0.2 - unversioned bir to python3 * Sat Oct 31 2015 Igor Gnatenko - 2.0.1-1 - Initial package