## START: Set by rpmautospec ## (rpmautospec version 0.2.6) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec # Tests are not meant to be run against installed version, says upstream # (https://github.com/pauldmccarthy/indexed_gzip/issues/13). Still, we manage # to make it work. Note that some tests are very slow. %bcond_without tests Name: python-indexed_gzip Version: 1.7.0 Release: %autorelease Summary: Fast random access of gzip files in Python License: zlib URL: https://github.com/pauldmccarthy/indexed_gzip Source0: %{pypi_source indexed_gzip} %global desc %{expand: The indexed_gzip project is a Python extension which aims to provide a drop-in replacement for the built-in Python gzip.GzipFile class, the IndexedGzipFile. indexed_gzip was written to allow fast random access of compressed NIFTI image files (for which GZIP is the de-facto compression standard), but will work with any GZIP file. indexed_gzip is easy to use with nibabel. The standard gzip.GzipFile class exposes a random access-like interface (via its seek and read methods), but every time you seek to a new point in the uncompressed data stream, the GzipFile instance has to start decompressing from the beginning of the file, until it reaches the requested location. An IndexedGzipFile instance gets around this performance limitation by building an index, which contains *seek points*, mappings between corresponding locations in the compressed and uncompressed data streams. Each seek point is accompanied by a chunk (32KB) of uncompressed data which is used to initialize the decompression algorithm, allowing us to start reading from any seek point. If the index is built with a seek point spacing of 1MB, we only have to decompress (on average) 512KB of data to read from any location in the file.} %description %{desc} %package -n python3-indexed_gzip Summary: %{summary} BuildRequires: python3-devel BuildRequires: gcc BuildRequires: zlib-devel %if %{with tests} # tests_require in setup.py: BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist numpy} BuildRequires: %{py3_dist nibabel} # added downstream to run tests in parallel: BuildRequires: %{py3_dist pytest-xdist} %endif %description -n python3-indexed_gzip %{desc} %generate_buildrequires %pyproject_buildrequires -r %prep %autosetup -n indexed_gzip-%{version} # Remove shebangs from non-script sources find indexed_gzip -type f -name '*.py' \ -exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' | xargs -r sed -r -i '1{/^#!/d}' # Make sure Cythonized C source files are not present in the tarball; they must # be regenerated. Retain “hand-written” C sources. find indexed_gzip -type f -name '*.pyx' | sed -r 's/\.pyx$/.c/' | xargs -r rm -vf %build %pyproject_wheel %install %pyproject_install %pyproject_save_files indexed_gzip %check %if %{with tests} # Consider running tests in parallel by default # https://github.com/pauldmccarthy/indexed_gzip/issues/101 %pytest %{buildroot}%{python3_sitearch}/indexed_gzip -n %{?_smp_build_ncpus} %endif %files -n python3-indexed_gzip -f %{pyproject_files} %doc README.md %changelog * Tue Sep 13 2022 Benjamin A. Beasley 1.7.0-1 - Update to 1.7.0 (close RHBZ#2126154) * Fri Jul 22 2022 Fedora Release Engineering 1.6.13-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jul 12 2022 Benjamin A. Beasley 1.6.13-4 - Run tests in parallel * Mon Jul 11 2022 Benjamin A. Beasley 1.6.13-3 - Fix extra newline in description * Tue Jun 14 2022 Python Maint 1.6.13-2 - Rebuilt for Python 3.11 * Fri Apr 15 2022 Benjamin A. Beasley 1.6.13-1 - Update to 1.6.13 (close RHBZ#2075570) * Fri Jan 21 2022 Fedora Release Engineering - 1.6.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Oct 19 2021 Benjamin A. Beasley - 1.6.4-1 - Update to 1.6.4 (close RHBZ#2015352) * Tue Sep 14 2021 Benjamin A. Beasley - 1.6.3-1 - Update to 1.6.3 (close RHBZ#2004204) - Stop using deprecated zero-argument version of pypi_source macro - Drop BR on pyproject-rpm-macros, since python3-devel now implies it - Let pyproject-rpm-macros handle the license file - Preserve mtimes on sources from which no shebang was removed * Sat Sep 04 2021 Benjamin A. Beasley - 1.6.2-1 - Update to 1.6.2 (close RHBZ#2000944) * Fri Jul 23 2021 Fedora Release Engineering - 1.6.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Mon Jul 19 2021 Benjamin A. Beasley - 1.6.1-1 - Update to 1.6.1 (closes RHBZ#1963719) - Make sure pre-generated Cython C sources really are removed - Drop %%py_provides, no longer needed after F32 - Use pyproject-rpm-macros - Run tests, despite https://github.com/pauldmccarthy/indexed_gzip/issues/13 * Fri Jun 04 2021 Python Maint - 1.5.3-2 - Rebuilt for Python 3.10 * Sun Mar 28 2021 Ankur Sinha - 1.5.3-1 - Update to latest release * Wed Jan 27 2021 Fedora Release Engineering - 1.4.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Sun Jan 10 2021 Ankur Sinha - 1.4.0-1 - Update to latest release * Sat Nov 28 2020 Ankur Sinha - 1.3.3-1 - Update to latest release * Wed Jul 29 2020 Fedora Release Engineering - 1.3.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Sat Jul 04 2020 Ankur Sinha - 1.3.2-1 - Update to new version * Thu Jun 25 2020 Ankur Sinha - 1.2.0-2 - Explicitly BR setuptools * Sun Jun 21 2020 Ankur Sinha - 1.2.0-1 - Update to 1.2.0 * Tue May 26 2020 Miro Hrončok - 1.1.0-2 - Rebuilt for Python 3.9 * Thu Jan 30 2020 Fedora Release Engineering - 0.8.10-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Thu Oct 03 2019 Miro Hrončok - 0.8.10-5 - Rebuilt for Python 3.8.0rc1 (#1748018) * Mon Aug 19 2019 Miro Hrončok - 0.8.10-4 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 0.8.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Mon May 20 2019 Ankur Sinha - 0.8.10-2 - Remove cythonised sources * Fri May 17 2019 Ankur Sinha - 0.8.10-1 - Update to newest release - rhbz: 1710384 * Wed Apr 10 2019 Ankur Sinha - 0.8.8-1 - Update to latest upstream release * Sat Feb 02 2019 Fedora Release Engineering - 0.8.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Nov 09 2018 Ankur Sinha - 0.8.7-1 - Initial build