Blob Blame History Raw
Name:		python-decopatch
Version:	1.4.10
Release:	%autorelease
Summary:	A helper to write python decorators

License:	BSD
Source0:	%{pypi_source decopatch}

BuildArch:	noarch
BuildRequires:	pyproject-rpm-macros

# There is a build dependency loop when built with tests.
# It involves pytest-cases, pytest-harvest, pytest-steps.
# This bcons allows to bootstrap it.
%bcond_without tests

%global _description %{expand:
Because of a tiny oddity in the python language, writing decorators without help
can be a pain because you have to handle the no-parenthesis usage explicitly.
Decopatch provides a simple way to solve this issue so that writing decorators
is simple and straightforward.}

%description %_description

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

%description -n python3-decopatch %_description

%autosetup -n decopatch-%{version}
cat >pyproject.toml <<EOF
requires = ["setuptools_scm"%{?with_tests:, "pypandoc", "pytest-cases"}]
build-backend = "setuptools.build_meta"

%pyproject_buildrequires -r


%pyproject_save_files decopatch

%if %{with tests}
PYTHONPATH=build/lib %python3 -m pytest -v

%files -n python3-decopatch
%license LICENSE