15
0
Files
python-argparse-manpage/python-argparse-manpage.spec
Markéta Machová 49d4799f16 Accepting request 1034370 from home:yarunachalam:branches:devel:languages:python
- Update to v4 
  News in v4
  The manual page generator logic is now separated from the 'build_manpages'
  module (which provides setup.py integration helpers). Therefore the
  argparse-manpage doesn't necessarily have to depend on setuptools.
  Projects that want to integrate using 'setup.py' should though place a new
  "extra" named 'argparse-manpage[setuptools]' into their set of build
  requirements in project.toml file.
  The old 'build_manpage' command (!= 'build_manpages') is now more
  isolated from the rest of the code, likely never loaded.
  the Manpage class API was changed in v3 so it required an additional
  constructor 'data' argument. This change was reverted, and the only
  argument is again the ArgumentParser object.
  The 'version' and 'description' options were fixed.
  New options 'manual_section' and 'manual_title' were added.
  The manual page now automatically generates a current date in headers.
  Several groff escaping issues were fixed.

OBS-URL: https://build.opensuse.org/request/show/1034370
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argparse-manpage?expand=0&rev=24
2022-11-08 09:42:53 +00:00

78 lines
2.5 KiB
RPMSpec

#
# spec file for package python-argparse-manpage
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define mod_name argparse-manpage
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-argparse-manpage
Version: 4
Release: 0
Summary: Tool for automatic manual page building from a Python ArgumentParser object
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/praiskup/argparse-manpage
Source: https://github.com/praiskup/argparse-manpage/archive/v%{version}.tar.gz
BuildArch: noarch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-setuptools
Requires(post): update-alternatives
Requires(postun):update-alternatives
%python_subpackages
%description
This utility generates a manual page in an automatic way from an
ArgumentParser object, so the manpage 1:1 corresponds to the
automatically generated --help output. The manpage generator needs to
known the location of the object, user can specify that by (a) the
module name or corresponding python filename and (b) the object name
or the function name which returns the object. There's a limited
support for (deprecated) optparse objects, too.
%prep
%setup -q -n %{mod_name}-%{version}
%build
%python_build
%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/argparse-manpage
%python_clone -a %{buildroot}%{_mandir}/man1/argparse-manpage.1
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%post
%{python_install_alternative argparse-manpage argparse-manpage.1}
%postun
%python_uninstall_alternative argparse-manpage
%files %{python_files}
%doc README*
%license LICENSE
%{python_sitelib}/*
%python_alternative %{_bindir}/argparse-manpage
%python_alternative %{_mandir}/man1/argparse-manpage.1%{?ext_man}
%changelog