forked from pool/python-sphinx-argparse
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
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.osc
|
20
LICENSE-sphinx-argparse
Normal file
20
LICENSE-sphinx-argparse
Normal file
@@ -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.
|
51
different_pytest_name.patch
Normal file
51
different_pytest_name.patch
Normal file
@@ -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',
|
18
python-sphinx-argparse.changes
Normal file
18
python-sphinx-argparse.changes
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 13 12:19:37 CET 2019 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- 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 <aloisio@gmx.com>
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
|
69
python-sphinx-argparse.spec
Normal file
69
python-sphinx-argparse.spec
Normal file
@@ -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
|
3
sphinx-argparse-0.2.5.tar.gz
Normal file
3
sphinx-argparse-0.2.5.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:60ab98f80ffd38731d62e267171388a421abbc96c74901b7785a8e058b438c17
|
||||||
|
size 12153
|
Reference in New Issue
Block a user