%global srcname beanhub-cli %global forgeurl https://github.com/LaunchPlatform/%{srcname} %bcond check 1 Name: python-%{srcname} Version: 2.1.1 Release: %autorelease Summary: Command line tools for BeanHub License: MIT URL: https://beanhub-cli-docs.beanhub.io # PyPI tarball doesn't include tests Source: %{forgeurl}/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel %if %{with check} BuildRequires: python3dist(pytest-httpx) BuildRequires: python3dist(pytest-mock) %endif %global _description %{expand: This package provides various command line tools for BeanHub and Beancount users.} %description %_description %package -n python3-%{srcname} Summary: %{summary} %description -n python3-%{srcname} %_description %pyproject_extras_subpkg -n python3-%{srcname} connect,login %prep %autosetup -p1 -n %{srcname}-%{version} %generate_buildrequires %pyproject_buildrequires -x connect,login %build %pyproject_wheel %install %pyproject_install %pyproject_save_files beanhub_cli %check %if %{with check} %pytest -v %else %pyproject_check_import %endif %files -n python3-%{srcname} -f %{pyproject_files} %doc README.md %{_bindir}/bh %changelog %autochangelog