9aff3ad
%global srcname numcodecs
9aff3ad
9aff3ad
Name:           python-%{srcname}
19806e2
Version:        0.12.1
47dd27a
Release:        %autorelease
9aff3ad
Summary:        Buffer compression and transformation for data storage and communication
9aff3ad
9aff3ad
License:        MIT
9aff3ad
URL:            https://github.com/alimanfoo/numcodecs
493a83b
Source0:        %pypi_source %{srcname}
9aff3ad
# Fedora specific
493a83b
Patch:          0001-Unbundle-blosc.patch
493a83b
Patch:          0002-Unbundle-zstd.patch
493a83b
Patch:          0003-Unbundle-lz4.patch
16b8ac9
# Fedora is not missing Snappy support in Blosc.
493a83b
Patch:          0004-Re-add-Snappy-to-tests.patch
ed06920
# We don't need coverage reports.
ed06920
Patch:          0005-Remove-coverage-from-testing-requirements.patch
9aff3ad
9aff3ad
BuildRequires:  gcc
9aff3ad
BuildRequires:  pkgconfig(blosc)
9aff3ad
BuildRequires:  pkgconfig(liblz4)
9aff3ad
BuildRequires:  pkgconfig(libzstd)
9aff3ad
BuildRequires:  python3-devel
9aff3ad
BuildRequires:  python3dist(cython)
9aff3ad
BuildRequires:  python3dist(pytest)
9aff3ad
9aff3ad
%description
9aff3ad
Numcodecs is a Python package providing buffer compression and transformation
9aff3ad
codecs for use in data storage and communication applications.
9aff3ad
9aff3ad
9aff3ad
%package -n     python3-%{srcname}
9aff3ad
Summary:        %{summary}
9aff3ad
9aff3ad
%description -n python3-%{srcname}
9aff3ad
Numcodecs is a Python package providing buffer compression and transformation
9aff3ad
codecs for use in data storage and communication applications.
9aff3ad
9aff3ad
9aff3ad
%package -n python-%{srcname}-doc
9aff3ad
Summary:        numcodecs documentation
9aff3ad
9aff3ad
BuildArch:      noarch
9aff3ad
9aff3ad
BuildRequires:  python3dist(numpydoc)
9aff3ad
BuildRequires:  python3dist(sphinx)
9aff3ad
BuildRequires:  python3dist(sphinx-issues)
9aff3ad
9aff3ad
%description -n python-%{srcname}-doc
9aff3ad
Documentation for numcodecs
9aff3ad
9aff3ad
9aff3ad
%prep
9aff3ad
%autosetup -n %{srcname}-%{version} -p1
9aff3ad
9aff3ad
# Remove bundled blosc
9aff3ad
rm -rf c-blosc
9aff3ad
9aff3ad
96f5e82
%generate_buildrequires
19806e2
%pyproject_buildrequires -x msgpack -x test_extras
96f5e82
96f5e82
9aff3ad
%build
96f5e82
%pyproject_wheel
9aff3ad
9aff3ad
# generate html docs
0e85152
PYTHONPATH="$PWD/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}" sphinx-build-3 docs html
9aff3ad
# remove the sphinx-build leftovers
9aff3ad
rm -rf html/.{doctrees,buildinfo} html/_static/donotdelete
9aff3ad
9aff3ad
9aff3ad
%install
96f5e82
%pyproject_install
96f5e82
%pyproject_save_files %{srcname}
9aff3ad
9aff3ad
9aff3ad
%check
9aff3ad
cd docs  # Avoid using unbuilt existing copy.
32cb101
ln -s ../fixture
b81111e
%{pytest} --pyargs numcodecs
9aff3ad
9aff3ad
96f5e82
%files -n python3-%{srcname} -f %{pyproject_files}
9aff3ad
%doc README.rst
ed06920
%license LICENSE.txt
9aff3ad
9aff3ad
%files -n python-%{srcname}-doc
9aff3ad
%doc html
ed06920
%license LICENSE.txt
9aff3ad
9aff3ad
9aff3ad
%changelog
47dd27a
%autochangelog