File python-cramjam.spec of Package python-cramjam

# spec file for package python-cramjam
# Copyright (c) 2024 SUSE LLC
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%define psuffix -test
%bcond_with test
%define psuffix %{nil}

# Adjust the version in _service and use `rm -rf cramjam; osc service runall` in order to update
%define modname cramjam
Name:           python-cramjam%{psuffix}
Version:        2.8.1
Release:        0
Summary:        Thin Python bindings to de/compression algorithms in Rust
License:        MIT
Source:         %{modname}-%{version}.tar.xz
Source1:        vendor.tar.xz
BuildRequires:  %{python_module base >= 3.7}
BuildRequires:  %{python_module maturin >= 0.13}
BuildRequires:  %{python_module pip}
BuildRequires:  cargo-packaging
BuildRequires:  python-rpm-macros
# SECTION test dependencies
%if %{with test}
BuildRequires:  %{python_module %{modname} = %{version}}
BuildRequires:  %{python_module hypothesis}
BuildRequires:  %{python_module memory_profiler}
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module pytest}
BuildRequires:  fdupes

Extremely thin Python bindings to de/compression algorithms in Rust.
Allows for using algorithms such as Snappy, without any system dependencies.

%setup -q -n %{modname}-%{version} -a1

%if %{without test}
pushd %{modname}-python

%if %{without test}
pushd %{modname}-python
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%if %{with test}
pushd %{modname}-python
%pytest_arch --ignore benchmarks

%if %{without test}
%files %{python_files}
%license LICENSE

openSUSE Build Service is sponsored by