From 4e1d28c75d0cb852c636e08487ccd9f8179a5322 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Fri, 10 Mar 2023 21:20:50 +0100 Subject: [PATCH] - python-sphinx_argparse.spec updated to 0.4.0 for python 3.7+ --- python-sphinx_argparse-tests.patch | 44 ----------- python-sphinx_argparse.spec | 117 ----------------------------- python3-sphinx_argparse.spec | 61 +++++++++++++++ 3 files changed, 61 insertions(+), 161 deletions(-) delete mode 100644 python-sphinx_argparse-tests.patch delete mode 100644 python-sphinx_argparse.spec create mode 100644 python3-sphinx_argparse.spec diff --git a/python-sphinx_argparse-tests.patch b/python-sphinx_argparse-tests.patch deleted file mode 100644 index f14c9cf..0000000 --- a/python-sphinx_argparse-tests.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- sphinx-argparse-0.2.5/test/test_parser.py.orig 2017-03-31 10:08:31.000000000 +0200 -+++ sphinx-argparse-0.2.5/test/test_parser.py 2020-10-31 10:09:03.610717045 +0100 -@@ -1,4 +1,6 @@ - import argparse -+import os -+import sys - from sphinxarg.parser import parse_parser, parser_navigate - - -@@ -140,6 +142,7 @@ - subparser.add_argument('--upgrade', action='store_true', default=False, help='foo2 help') - - data = parse_parser(parser) -+ cmd = os.path.basename(sys.argv[0]) - - assert data['action_groups'][0]['options'] == [ - { -@@ -157,8 +160,8 @@ - { - 'name': 'install', - 'help': 'install help', -- 'usage': 'usage: py.test install [-h] [--upgrade] ref', -- 'bare_usage': 'py.test install [-h] [--upgrade] ref', -+ 'usage': 'usage: ' + cmd + ' install [-h] [--upgrade] ref', -+ 'bare_usage': cmd + ' install [-h] [--upgrade] ref', - 'action_groups': [ - { - 'title': 'Positional Arguments', -@@ -219,12 +222,13 @@ - ] - - data2 = parser_navigate(data, 'level1 level2') -+ cmd = os.path.basename(sys.argv[0]) - assert data2['children'] == [ - { - 'name': 'level3', - 'help': '', -- 'usage': 'usage: py.test level1 level2 level3 [-h] foo bar', -- 'bare_usage': 'py.test level1 level2 level3 [-h] foo bar', -+ 'usage': 'usage: ' + cmd + ' level1 level2 level3 [-h] foo bar', -+ 'bare_usage': cmd + ' level1 level2 level3 [-h] foo bar', - 'action_groups': [ - { - 'title': 'Positional Arguments', diff --git a/python-sphinx_argparse.spec b/python-sphinx_argparse.spec deleted file mode 100644 index 1dfa68b..0000000 --- a/python-sphinx_argparse.spec +++ /dev/null @@ -1,117 +0,0 @@ -# -# Conditional build: -%bcond_without tests # unit tests -%bcond_without python2 # CPython 2.x module -%bcond_without python3 # CPython 3.x module - -Summary: Sphinx extension that automatically documents argparse commands and options -Summary(pl.UTF-8): Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje argparse -Name: python-sphinx_argparse -# keep 0.2.x here for python2 support -Version: 0.2.5 -Release: 4 -License: MIT -Group: Libraries/Python -#Source0Download: https://pypi.org/simple/sphinx-argparse/ -Source0: https://files.pythonhosted.org/packages/source/s/sphinx-argparse/sphinx-argparse-%{version}.tar.gz -# Source0-md5: b137944fbbe26c88d54ee106bf0569ab -Patch0: %{name}-tests.patch -URL: https://pypi.org/project/sphinx-argparse/ -%if %{with python2} -BuildRequires: python-modules >= 1:2.7 -BuildRequires: python-setuptools -%if %{with tests} -BuildRequires: python-Sphinx >= 1.2.0 -BuildRequires: python-pytest -%endif -%endif -%if %{with python3} -BuildRequires: python3-modules >= 1:3.5 -BuildRequires: python3-setuptools -%if %{with tests} -BuildRequires: python3-Sphinx >= 1.2.0 -BuildRequires: python3-pytest -%endif -%endif -BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.714 -Requires: python-modules >= 1:2.7 -Conflicts: python-commonmark < 0.5.6 -BuildArch: noarch -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) - -%description -Sphinx extension that automatically documents argparse commands and -options. - -%description -l pl.UTF-8 -Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje -argparse. - -%package -n python3-sphinx_argparse -Summary: Sphinx extension that automatically documents argparse commands and options -Summary(pl.UTF-8): Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje argparse -Group: Libraries/Python -Requires: python3-modules >= 1:3.5 -Conflicts: python3-commonmark < 0.5.6 - -%description -n python3-sphinx_argparse -Sphinx extension that automatically documents argparse commands and -options. - -%description -n python3-sphinx_argparse -l pl.UTF-8 -Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje -argparse. - -%prep -%setup -q -n sphinx-argparse-%{version} -%patch0 -p1 - -%build -%if %{with python2} -%py_build - -%if %{with tests} -%{__python} -m pytest test -%endif -%endif - -%if %{with python3} -%py3_build - -%if %{with tests} -%{__python3} -m pytest test -%endif -%endif - -%install -rm -rf $RPM_BUILD_ROOT - -%if %{with python2} -%py_install - -%py_postclean -%endif - -%if %{with python3} -%py3_install -%endif - -%clean -rm -rf $RPM_BUILD_ROOT - -%if %{with python2} -%files -%defattr(644,root,root,755) -%doc README.md -%{py_sitescriptdir}/sphinxarg -%{py_sitescriptdir}/sphinx_argparse-%{version}-py*.egg-info -%endif - -%if %{with python3} -%files -n python3-sphinx_argparse -%defattr(644,root,root,755) -%doc README.md -%{py3_sitescriptdir}/sphinxarg -%{py3_sitescriptdir}/sphinx_argparse-%{version}-py*.egg-info -%endif diff --git a/python3-sphinx_argparse.spec b/python3-sphinx_argparse.spec new file mode 100644 index 0000000..b323629 --- /dev/null +++ b/python3-sphinx_argparse.spec @@ -0,0 +1,61 @@ +# +# Conditional build: +%bcond_without tests # unit tests + +Summary: Sphinx extension that automatically documents argparse commands and options +Summary(pl.UTF-8): Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje argparse +Name: python3-sphinx_argparse +Version: 0.4.0 +Release: 1 +License: MIT +Group: Libraries/Python +#Source0Download: https://pypi.org/simple/sphinx-argparse/ +Source0: https://files.pythonhosted.org/packages/source/s/sphinx-argparse/sphinx_argparse-%{version}.tar.gz +# Source0-md5: db32f8c3208cf136b29268d1bdf61f71 +URL: https://pypi.org/project/sphinx-argparse/ +BuildRequires: python3-modules >= 1:3.7 +BuildRequires: python3-setuptools +%if %{with tests} +BuildRequires: python3-Sphinx >= 1.2.0 +BuildRequires: python3-pytest +%endif +BuildRequires: rpm-pythonprov +BuildRequires: rpmbuild(macros) >= 1.714 +Requires: python3-modules >= 1:3.7 +Conflicts: python3-commonmark < 0.5.6 +BuildArch: noarch +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +Sphinx extension that automatically documents argparse commands and +options. + +%description -l pl.UTF-8 +Rozszerzenie Sphinksa automatycznie dokumentujące polecenia i opcje +argparse. + +%prep +%setup -q -n sphinx_argparse-%{version} + +%build +%py3_build + +%if %{with tests} +%{__python3} -m pytest test +%endif + +%install +rm -rf $RPM_BUILD_ROOT + +%py3_install + +%{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/test + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc LICENSE README.md +%{py3_sitescriptdir}/sphinxarg +%{py3_sitescriptdir}/sphinx_argparse-%{version}-py*.egg-info -- 2.44.0