Hello community, here is the log from the commit of package python3-argh for openSUSE:Factory checked in at 2016-07-28 23:45:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-argh (Old) and /work/SRC/openSUSE:Factory/.python3-argh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-argh" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-argh/python3-argh.changes 2016-05-25 21:23:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-argh.new/python3-argh.changes 2016-07-28 23:45:58.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Jul 22 15:51:31 UTC 2016 - a...@gmx.de + +- update to version 0.26.2: + * Removed official support for Python 3.4, added for 3.5. + * Various tox-related improvements for development. + * Improved documentation. + +------------------------------------------------------------------- @@ -7 +14,0 @@ - Old: ---- argh-0.26.1.tar.gz New: ---- argh-0.26.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-argh.spec ++++++ --- /var/tmp/diff_new_pack.cGFMTG/_old 2016-07-28 23:45:59.000000000 +0200 +++ /var/tmp/diff_new_pack.cGFMTG/_new 2016-07-28 23:45:59.000000000 +0200 @@ -17,7 +17,7 @@ Name: python3-argh -Version: 0.26.1 +Version: 0.26.2 Release: 0 Url: http://github.com/neithere/argh/ Summary: A simple argparse wrapper ++++++ 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='')