Blob Blame History Raw
%global srcname  Cerberus
%global slugname cerberus
%global pkgname  python-cerberus
%global forgeurl

%global common_description %{expand:
Cerberus is a lightweight and extensible data validation library for Python.

Cerberus provides type checking and other base functionality out of the box
and is designed to be non-blocking and easily extensible, allowing for custom
validation. It has no dependancies and is thoroughly tested.

%bcond_without tests

Name:           %{pkgname}
Version:        1.3.4
# Remove -b4 when upgrading to a newer version:
Release:        %autorelease -b4
Summary:        Lightweight, extensible data validation library for Python
License:        ISC
URL:            %{forgeurl}
Source0:        %{pypi_source}
BuildArch:      noarch

BuildRequires:  python3-devel
BuildRequires:  pyproject-rpm-macros

%if %{with tests}
BuildRequires:  python3dist(pytest)

%description %{common_description}

%package -n python3-%{slugname}
Summary: %{summary}

%description -n python3-%{slugname} %{common_description}

%autosetup -n %{srcname}-%{version} -p1

%pyproject_buildrequires -r %{?with_tests:-x test}


%pyproject_save_files %{slugname}

%if %{with tests}
%pytest -vv %{slugname}/tests

%files -n python3-%{slugname}
%license LICENSE