67e14fd
# tests are enabled by default
67e14fd
%bcond_without  tests
67e14fd
264ecee
%global         srcname     knack
264ecee
%global         forgeurl    https://github.com/microsoft/knack
e60abcd
Version:        0.11.0
264ecee
Epoch:          1
264ecee
%global         tag         v%{version}
264ecee
%forgemeta
264ecee
264ecee
Name:           python-%{srcname}
264ecee
Release:        %autorelease
67e14fd
Summary:        A Command-Line Interface framework
264ecee
67e14fd
License:        MIT
264ecee
URL:            %forgeurl
264ecee
Source0:        %forgesource
67e14fd
67e14fd
BuildArch:      noarch
67e14fd
67e14fd
BuildRequires:  python3-devel
67e14fd
67e14fd
%if %{with tests}
264ecee
BuildRequires:  python3dist(pytest)
67e14fd
%endif
67e14fd
67e14fd
%global _description %{expand:
67e14fd
A Command-Line Interface framework}
67e14fd
67e14fd
%description %{_description}
67e14fd
67e14fd
67e14fd
%package -n python3-%{srcname}
67e14fd
Summary:        %{summary}
67e14fd
67e14fd
%description -n python3-%{srcname} %{_description}
67e14fd
67e14fd
67e14fd
%prep
264ecee
%forgeautosetup -p1
67e14fd
67e14fd
264ecee
%generate_buildrequires
264ecee
%pyproject_buildrequires -r
264ecee
264ecee
67e14fd
%build
264ecee
%pyproject_wheel
67e14fd
67e14fd
67e14fd
%install
264ecee
%pyproject_install
264ecee
%pyproject_save_files knack
67e14fd
67e14fd
67e14fd
%if %{with tests}
67e14fd
%check
67e14fd
# Skip the tests which require network connectivity.
b8502ed
%pytest --disable-warnings
67e14fd
%endif
67e14fd
67e14fd
264ecee
%files -n python3-%{srcname} -f %{pyproject_files}
264ecee
%doc *.rst
67e14fd
67e14fd
67e14fd
%changelog
264ecee
%autochangelog