%global srcname sphinx-argparse
%global sum Sphinx extension that automatically documents argparse commands and options
Name: python-%{srcname}
Version: 0.3.1
Release: %autorelease
Summary: %{sum}
BuildArch: noarch
License: MIT
Url: https://github.com/ashb/sphinx-argparse
Source0: https://github.com/ashb/sphinx-argparse/archive/%{version}.tar.gz
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
# for checks
BuildRequires: python3-pytest
BuildRequires: python3-six
%description
Sphinx extension that automatically documents argparse commands and options
%package -n python3-%{srcname}
Summary: %{sum}
%description -n python3-%{srcname}
Sphinx extension that automatically documents argparse commands and options
%prep
%autosetup -n %{srcname}-%{version}
# Required for python-3.10
# https://github.com/ashb/sphinx-argparse/pull/3
sed -i -e "s/'optional arguments':/'optional arguments' or action_group.title == 'options':/" sphinxarg/parser.py
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files sphinxarg
%check
%pytest
%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE
%doc README.md
%changelog
%autochangelog