From c7892ef2212d40d0179495b4b21863e2f2f15b0a96cc921412dfed563fa163c2 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 13 Dec 2019 13:34:24 +0000 Subject: [PATCH] Accepting request 756804 from home:alois:branches:devel:languages:python new package (5th attempt) OBS-URL: https://build.opensuse.org/request/show/756804 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sphinx-argparse?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + LICENSE-sphinx-argparse | 20 ++++++++++ different_pytest_name.patch | 51 +++++++++++++++++++++++++ python-sphinx-argparse.changes | 18 +++++++++ python-sphinx-argparse.spec | 69 ++++++++++++++++++++++++++++++++++ sphinx-argparse-0.2.5.tar.gz | 3 ++ 7 files changed, 185 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE-sphinx-argparse create mode 100644 different_pytest_name.patch create mode 100644 python-sphinx-argparse.changes create mode 100644 python-sphinx-argparse.spec create mode 100644 sphinx-argparse-0.2.5.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/LICENSE-sphinx-argparse b/LICENSE-sphinx-argparse new file mode 100644 index 0000000..fdb9c51 --- /dev/null +++ b/LICENSE-sphinx-argparse @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Alex Rudakov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/different_pytest_name.patch b/different_pytest_name.patch new file mode 100644 index 0000000..45a2d66 --- /dev/null +++ b/different_pytest_name.patch @@ -0,0 +1,51 @@ +--- a/test/test_parser.py ++++ b/test/test_parser.py +@@ -1,4 +1,8 @@ + import argparse ++import os ++import sys ++print("sys.path = {}".format(sys.path)) ++ + from sphinxarg.parser import parse_parser, parser_navigate + + +@@ -129,6 +133,8 @@ def test_parse_description(): + + + def test_parse_nested(): ++ pytest_name = os.environ['PYTEST_NAME'] if 'PYTEST_NAME' in os.environ \ ++ else 'py.test' + parser = argparse.ArgumentParser() + parser.add_argument('foo', default=False, help='foo help') + parser.add_argument('bar', default=False) +@@ -157,8 +163,8 @@ def test_parse_nested(): + { + 'name': 'install', + 'help': 'install help', +- 'usage': 'usage: py.test install [-h] [--upgrade] ref', +- 'bare_usage': 'py.test install [-h] [--upgrade] ref', ++ 'usage': 'usage: {} install [-h] [--upgrade] ref'.format(pytest_name), ++ 'bare_usage': '{} install [-h] [--upgrade] ref'.format(pytest_name), + 'action_groups': [ + { + 'title': 'Positional Arguments', +@@ -188,6 +194,8 @@ def test_parse_nested(): + + + def test_parse_nested_traversal(): ++ pytest_name = os.environ['PYTEST_NAME'] if 'PYTEST_NAME' in os.environ \ ++ else 'py.test' + parser = argparse.ArgumentParser() + + subparsers1 = parser.add_subparsers() +@@ -223,8 +231,8 @@ def test_parse_nested_traversal(): + { + '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: {} level1 level2 level3 [-h] foo bar'.format(pytest_name), ++ 'bare_usage': '{} level1 level2 level3 [-h] foo bar'.format(pytest_name), + 'action_groups': [ + { + 'title': 'Positional Arguments', diff --git a/python-sphinx-argparse.changes b/python-sphinx-argparse.changes new file mode 100644 index 0000000..b14a329 --- /dev/null +++ b/python-sphinx-argparse.changes @@ -0,0 +1,18 @@ +------------------------------------------------------------------- +Fri Dec 13 12:19:37 CET 2019 - Matej Cepl + +- Add different_pytest_name.patch to use environmental variable + PYTEST_NAME to find out what's the current name of the pytest + executable. gh#alex-rudakov/sphinx-argparse#121 + +------------------------------------------------------------------- +Sat Dec 7 12:47:24 UTC 2019 - Luigi Baldoni + +- Update to version 0.2.5 +- Added license file + +------------------------------------------------------------------- +Tue Jul 19 04:17:24 UTC 2016 - tbechtold@suse.com + +- Initial packaging (version 0.1.15) + diff --git a/python-sphinx-argparse.spec b/python-sphinx-argparse.spec new file mode 100644 index 0000000..045e29b --- /dev/null +++ b/python-sphinx-argparse.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-sphinx-argparse +# +# Copyright (c) 2019 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +Name: python-sphinx-argparse +Version: 0.2.5 +Release: 0 +Summary: Sphinx extension to document argparse commands and options +License: MIT +Group: Development/Languages/Python +URL: https://github.com/ribozz/sphinx-argparse +Source0: https://files.pythonhosted.org/packages/source/s/sphinx-argparse/sphinx-argparse-%{version}.tar.gz +Source1: https://raw.githubusercontent.com/alex-rudakov/sphinx-argparse/%{version}/LICENSE#/LICENSE-sphinx-argparse +# PATCH-FIX-UPSTREAM different_pytest_name.patch gh#alex-rudakov/sphinx-argparse#121 mcepl@suse.com +# Use environmental variable PYTEST_NAME for different names of the pytest executable +Patch0: different_pytest_name.patch +BuildRequires: %{python_module CommonMark} +BuildRequires: %{python_module Sphinx >= 1.2.0} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +Sphinx extension that automatically documents argparse commands and options. + +%prep +%setup -q -n sphinx-argparse-%{version} +%autopatch -p1 + +install -m0644 %{SOURCE1} LICENSE + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# can't use %%pytest until gh#alex-rudakov/sphinx-argparse#121 is solved +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} PYTEST_NAME="py.test-%{$python_bin_suffix}" +$PYTEST_NAME --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -vv +} + +%files %{python_files} +%license LICENSE +%doc README.md +%{python_sitelib}/* + +%changelog diff --git a/sphinx-argparse-0.2.5.tar.gz b/sphinx-argparse-0.2.5.tar.gz new file mode 100644 index 0000000..23d9fa0 --- /dev/null +++ b/sphinx-argparse-0.2.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60ab98f80ffd38731d62e267171388a421abbc96c74901b7785a8e058b438c17 +size 12153