580a320
Name:           python-decopatch
580a320
Version:        1.4.10
580a320
Release:        %autorelease
580a320
Summary:        Helper to write python decorators
784049d
67f44ee
License:        BSD-3-Clause
580a320
URL:            https://pypi.org/project/decopatch
580a320
Source:	        %{pypi_source decopatch}
86a95d4
Patch:          0001-Adjust-for-whitespace-changes-with-python-3.12.patch
784049d
784049d
BuildArch:	noarch
784049d
BuildRequires:	pyproject-rpm-macros
784049d
d017d57
# There is a build dependency loop when built with tests.
d017d57
# It involves pytest-cases, pytest-harvest, pytest-steps.
d017d57
# This bcons allows to bootstrap it.
580a320
%bcond tests 1
d017d57
784049d
%global _description %{expand:
eecacd2
Because of a tiny oddity in the python language, writing decorators without help
eecacd2
can be a pain because you have to handle the no-parenthesis usage explicitly.
eecacd2
Decopatch provides a simple way to solve this issue so that writing decorators
eecacd2
is simple and straightforward.}
784049d
784049d
%description %_description
784049d
784049d
%package -n python3-decopatch
784049d
Summary: %{summary}
784049d
784049d
%description -n python3-decopatch %_description
784049d
784049d
%prep
86a95d4
%autosetup -p 1 -n decopatch-%{version}
784049d
cat >pyproject.toml <
784049d
[build-system]
d017d57
requires = ["setuptools_scm"%{?with_tests:, "pypandoc", "pytest-cases"}]
784049d
build-backend = "setuptools.build_meta"
784049d
EOF
784049d
784049d
%generate_buildrequires
d017d57
%pyproject_buildrequires -r
784049d
784049d
%build
784049d
%pyproject_wheel
784049d
784049d
%install
784049d
%pyproject_install
d017d57
%pyproject_save_files decopatch
784049d
784049d
%check
d017d57
%if %{with tests}
eecacd2
PYTHONPATH=build/lib %python3 -m pytest -v
d017d57
%else
d017d57
%pyproject_check_import
d017d57
%endif
784049d
784049d
%files -n python3-decopatch
784049d
%license LICENSE
784049d
%doc README.md
784049d
%{python3_sitelib}/decopatch/
784049d
%{python3_sitelib}/decopatch-%{version}.dist-info/
784049d
784049d
%changelog
01aa985
%autochangelog