Hello community, here is the log from the commit of package python-argh for openSUSE:Factory checked in at 2019-03-05 12:25:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-argh (Old) and /work/SRC/openSUSE:Factory/.python-argh.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-argh" Tue Mar 5 12:25:11 2019 rev:14 rq:681523 version:0.26.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-argh/python-argh.changes 2018-12-12 17:26:21.907038320 +0100 +++ /work/SRC/openSUSE:Factory/.python-argh.new.28833/python-argh.changes 2019-03-05 12:25:21.552840745 +0100 @@ -1,0 +2,7 @@ +Mon Mar 4 16:59:56 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 0.26.2: + * no changelog available +- Drop no longer needed python-argh-0.26.1-fix-testsuite.patch + +------------------------------------------------------------------- Old: ---- argh-0.26.1.tar.gz python-argh-0.26.1-fix-testsuite.patch New: ---- argh-0.26.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-argh.spec ++++++ --- /var/tmp/diff_new_pack.q6AWnU/_old 2019-03-05 12:25:22.496840457 +0100 +++ /var/tmp/diff_new_pack.q6AWnU/_new 2019-03-05 12:25:22.496840457 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-argh # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,28 +16,21 @@ # -%bcond_without tests - %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-argh -Version: 0.26.1 +Version: 0.26.2 Release: 0 Summary: An argparse wrapper License: LGPL-3.0-or-later Group: Development/Languages/Python -Url: https://github.com/neithere/argh/ +URL: https://github.com/neithere/argh/ Source: https://files.pythonhosted.org/packages/source/a/argh/argh-%{version}.tar.gz -# PATCH-FIX-OPENSUSE python-argh-0.26.1-fix-testsuite.patch -- so that tests can run on OBS -Patch0: python-argh-0.26.1-fix-testsuite.patch +BuildRequires: %{python_module iocapture} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -# test requirements -%if %{with tests} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module pytest} -%endif -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %python_subpackages @@ -63,7 +56,6 @@ %prep %setup -q -n argh-%{version} -%patch0 -p1 %build %python_build @@ -72,14 +64,11 @@ %python_install %python_expand %fdupes -s %{buildroot}%{$python_sitelib} -%if %{with tests} %check export LC_CTYPE="en_US.UTF-8" %python_exec setup.py test -%endif %files %{python_files} -%defattr(-,root,root,-) %doc README.rst %{python_sitelib}/argh/ %{python_sitelib}/argh-%{version}-py*.egg-info ++++++ argh-0.26.1.tar.gz -> argh-0.26.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/PKG-INFO new/argh-0.26.2/PKG-INFO --- old/argh-0.26.1/PKG-INFO 2014-10-30 14:53:48.000000000 +0100 +++ new/argh-0.26.2/PKG-INFO 2016-05-11 22:54:53.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: argh -Version: 0.26.1 +Version: 0.26.2 Summary: An unobtrusive argparse wrapper with natural syntax Home-page: http://github.com/neithere/argh/ Author: Andrey Mikhaylenko @@ -9,11 +9,32 @@ Description: Argh: The Natural CLI ===================== - .. image:: https://badge.fury.io/py/argh.png - :target: http://badge.fury.io/py/argh + .. image:: https://img.shields.io/coveralls/neithere/argh.svg + :target: https://coveralls.io/r/neithere/argh - .. image:: https://travis-ci.org/neithere/argh.png?branch=master - :target: https://travis-ci.org/neithere/argh + .. image:: https://img.shields.io/travis/neithere/argh.svg + :target: https://travis-ci.org/neithere/argh + + .. image:: https://img.shields.io/pypi/format/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/status/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/v/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/pyversions/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/dd/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://readthedocs.org/projects/argh/badge/?version=stable + :target: http://argh.readthedocs.org/en/stable/ + + .. image:: https://readthedocs.org/projects/argh/badge/?version=latest + :target: http://argh.readthedocs.org/en/latest/ Building a command-line interface? Found yourself uttering "argh!" while struggling with the API of `argparse`? Don't like the complexity but need diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/README.rst new/argh-0.26.2/README.rst --- old/argh-0.26.1/README.rst 2014-10-27 13:40:45.000000000 +0100 +++ new/argh-0.26.2/README.rst 2015-10-12 23:01:26.000000000 +0200 @@ -1,11 +1,32 @@ Argh: The Natural CLI ===================== -.. image:: https://badge.fury.io/py/argh.png - :target: http://badge.fury.io/py/argh +.. image:: https://img.shields.io/coveralls/neithere/argh.svg + :target: https://coveralls.io/r/neithere/argh -.. image:: https://travis-ci.org/neithere/argh.png?branch=master - :target: https://travis-ci.org/neithere/argh +.. image:: https://img.shields.io/travis/neithere/argh.svg + :target: https://travis-ci.org/neithere/argh + +.. image:: https://img.shields.io/pypi/format/argh.svg + :target: https://pypi.python.org/pypi/argh + +.. image:: https://img.shields.io/pypi/status/argh.svg + :target: https://pypi.python.org/pypi/argh + +.. image:: https://img.shields.io/pypi/v/argh.svg + :target: https://pypi.python.org/pypi/argh + +.. image:: https://img.shields.io/pypi/pyversions/argh.svg + :target: https://pypi.python.org/pypi/argh + +.. image:: https://img.shields.io/pypi/dd/argh.svg + :target: https://pypi.python.org/pypi/argh + +.. image:: https://readthedocs.org/projects/argh/badge/?version=stable + :target: http://argh.readthedocs.org/en/stable/ + +.. image:: https://readthedocs.org/projects/argh/badge/?version=latest + :target: http://argh.readthedocs.org/en/latest/ Building a command-line interface? Found yourself uttering "argh!" while struggling with the API of `argparse`? Don't like the complexity but need diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/argh/__init__.py new/argh-0.26.2/argh/__init__.py --- old/argh-0.26.1/argh/__init__.py 2014-10-30 14:49:00.000000000 +0100 +++ new/argh-0.26.2/argh/__init__.py 2016-05-11 22:39:17.000000000 +0200 @@ -16,4 +16,4 @@ from .helpers import * -__version__ = '0.26.1' +__version__ = '0.26.2' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/argh/decorators.py new/argh-0.26.2/argh/decorators.py --- old/argh-0.26.1/argh/decorators.py 2014-10-25 23:51:47.000000000 +0200 +++ new/argh-0.26.2/argh/decorators.py 2016-05-11 21:29:24.000000000 +0200 @@ -76,29 +76,49 @@ def arg(*args, **kwargs): """ Declares an argument for given function. Does not register the function - anywhere, nor does it modify the function in any way. The signature is - exactly the same as that of :meth:`argparse.ArgumentParser.add_argument`, - only some keywords are not required if they can be easily guessed. + anywhere, nor does it modify the function in any way. + + The signature of the decorator matches that of + :meth:`argparse.ArgumentParser.add_argument`, only some keywords are not + required if they can be easily guessed (e.g. you don't have to specify type + or action when an `int` or `bool` default value is supplied). + + Typical use cases: + + - In combination with :func:`expects_obj` (which is not recommended); + - in combination with ordinary function signatures to add details that + cannot be expressed with that syntax (e.g. help message). Usage:: - @arg('path') - @arg('--format', choices=['yaml','json'], default='json') - @arg('--dry-run', default=False) - @arg('-v', '--verbosity', choices=range(0,3), default=1) - def load(args): + from argh import arg + + @arg('path', help='path to the file to load') + @arg('--format', choices=['yaml','json']) + @arg('-v', '--verbosity', choices=range(0,3), default=2) + def load(path, something=None, format='json', dry_run=False, verbosity=1): loaders = {'json': json.load, 'yaml': yaml.load} loader = loaders[args.format] data = loader(args.path) if not args.dry_run: - if 1 < verbosity: + if verbosity < 1: print('saving to the database') put_to_database(data) - Note that: + In this example: + + - `path` declaration is extended with `help`; + - `format` declaration is extended with `choices`; + - `dry_run` declaration is not duplicated; + - `verbosity` is extended with `choices` and the default value is + overridden. (If both function signature and `@arg` define a default + value for an argument, `@arg` wins.) + + .. note:: - * you didn't have to specify ``action="store_true"`` for ``--dry-run``; - * you didn't have to specify ``type=int`` for ``--verbosity``. + It is recommended to avoid using this decorator unless there's no way + to tune the argument's behaviour or presentation using ordinary + function signatures. Readability counts, don't repeat yourself. """ def wrapper(func): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/argh.egg-info/PKG-INFO new/argh-0.26.2/argh.egg-info/PKG-INFO --- old/argh-0.26.1/argh.egg-info/PKG-INFO 2014-10-30 14:53:47.000000000 +0100 +++ new/argh-0.26.2/argh.egg-info/PKG-INFO 2016-05-11 22:54:51.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: argh -Version: 0.26.1 +Version: 0.26.2 Summary: An unobtrusive argparse wrapper with natural syntax Home-page: http://github.com/neithere/argh/ Author: Andrey Mikhaylenko @@ -9,11 +9,32 @@ Description: Argh: The Natural CLI ===================== - .. image:: https://badge.fury.io/py/argh.png - :target: http://badge.fury.io/py/argh + .. image:: https://img.shields.io/coveralls/neithere/argh.svg + :target: https://coveralls.io/r/neithere/argh - .. image:: https://travis-ci.org/neithere/argh.png?branch=master - :target: https://travis-ci.org/neithere/argh + .. image:: https://img.shields.io/travis/neithere/argh.svg + :target: https://travis-ci.org/neithere/argh + + .. image:: https://img.shields.io/pypi/format/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/status/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/v/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/pyversions/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://img.shields.io/pypi/dd/argh.svg + :target: https://pypi.python.org/pypi/argh + + .. image:: https://readthedocs.org/projects/argh/badge/?version=stable + :target: http://argh.readthedocs.org/en/stable/ + + .. image:: https://readthedocs.org/projects/argh/badge/?version=latest + :target: http://argh.readthedocs.org/en/latest/ Building a command-line interface? Found yourself uttering "argh!" while struggling with the API of `argparse`? Don't like the complexity but need diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/argh.egg-info/SOURCES.txt new/argh-0.26.2/argh.egg-info/SOURCES.txt --- old/argh-0.26.1/argh.egg-info/SOURCES.txt 2014-10-30 14:53:48.000000000 +0100 +++ new/argh-0.26.2/argh.egg-info/SOURCES.txt 2016-05-11 22:54:52.000000000 +0200 @@ -1,5 +1,6 @@ MANIFEST.in README.rst +setup.cfg setup.py argh/__init__.py argh/assembling.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/setup.cfg new/argh-0.26.2/setup.cfg --- old/argh-0.26.1/setup.cfg 2014-10-30 14:53:48.000000000 +0100 +++ new/argh-0.26.2/setup.cfg 2016-05-11 22:54:53.000000000 +0200 @@ -1,5 +1,8 @@ +[bdist_wheel] +universal = 1 + [egg_info] -tag_svn_revision = 0 -tag_date = 0 tag_build = +tag_date = 0 +tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/setup.py new/argh-0.26.2/setup.py --- old/argh-0.26.1/setup.py 2014-10-25 23:51:47.000000000 +0200 +++ new/argh-0.26.2/setup.py 2016-05-11 21:05:03.000000000 +0200 @@ -82,7 +82,7 @@ install_requires = install_requires, # testing - tests_require = ['pytest'], + tests_require = ['pytest', 'mock', 'iocapture'], cmdclass = {'test': PyTest}, # copyright diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/test/base.py new/argh-0.26.2/test/base.py --- old/argh-0.26.1/test/base.py 2014-07-05 13:41:39.000000000 +0200 +++ new/argh-0.26.2/test/base.py 2015-10-12 23:57:49.000000000 +0200 @@ -3,6 +3,7 @@ Common stuff for tests ~~~~~~~~~~~~~~~~~~~~~~ """ +import os import sys from collections import namedtuple @@ -80,3 +81,8 @@ else: if exit: raise AssertionError('Did not exit') + + +def get_usage_string(definitions='{cmd} ...'): + prog = os.path.basename(sys.argv[0]) + return 'usage: ' + prog + ' [-h] ' + definitions + '\n\n' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/argh-0.26.1/test/test_integration.py new/argh-0.26.2/test/test_integration.py --- old/argh-0.26.1/test/test_integration.py 2014-10-25 23:53:34.000000000 +0200 +++ new/argh-0.26.2/test/test_integration.py 2015-10-13 00:54:21.000000000 +0200 @@ -7,13 +7,14 @@ import re import argparse +import iocapture import mock import pytest import argh from argh.exceptions import AssemblingError -from .base import DebugArghParser, run, CmdResult as R +from .base import DebugArghParser, get_usage_string, run, CmdResult as R @pytest.mark.xfail(reason='TODO') @@ -760,6 +761,22 @@ assert func.__doc__ in p.format_help() +def test_prog(): + "Program name propagates from sys.argv[0]" + + def cmd(foo=1): + return foo + + p = DebugArghParser() + p.add_commands([cmd]) + + usage = get_usage_string() + + with iocapture.capture() as captured: + assert run(p, '-h', exit=True) == None + assert captured.stdout.startswith(usage) + + def test_unknown_args(): def cmd(foo=1): @@ -768,8 +785,9 @@ p = DebugArghParser() p.set_default_command(cmd) + usage = get_usage_string('[-f FOO]') + assert run(p, '--foo 1') == R(out='1\n', err='') assert run(p, '--bar 1', exit=True) == 'unrecognized arguments: --bar 1' assert run(p, '--bar 1', exit=False, - kwargs={'skip_unknown_args': True}) == \ - R(out='usage: py.test [-h] [-f FOO]\n\n', err='') + kwargs={'skip_unknown_args': True}) == R(out=usage, err='')
