Hello community, here is the log from the commit of package python-debtcollector for openSUSE:Factory checked in at 2015-09-03 18:05:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-debtcollector (Old) and /work/SRC/openSUSE:Factory/.python-debtcollector.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-debtcollector" Changes: -------- --- /work/SRC/openSUSE:Factory/python-debtcollector/python-debtcollector.changes 2015-08-27 08:54:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-debtcollector.new/python-debtcollector.changes 2015-09-03 18:12:40.000000000 +0200 @@ -1,0 +2,20 @@ +Tue Aug 4 06:07:22 UTC 2015 - tbecht...@suse.com + +- update to 0.7.0 + * Updated from global requirements + * Expose a top level 'deprecate' function + * Add @removals.removed_kwarg on an __init__ method + * Improve + test keyword argument @classmethod removal + * Add example for removing a @classmethod + +------------------------------------------------------------------- +Tue Jul 28 08:01:35 UTC 2015 - tbecht...@suse.com + +- update to 0.6.0: + * Ensure doctesting and doc8 testing done in py27 env + * Updated from global requirements + * Fix quoting of examples + * Updated from global requirements + * Switch badges from 'pypip.in' to 'shields.io' + +------------------------------------------------------------------- Old: ---- debtcollector-0.5.0.tar.gz New: ---- debtcollector-0.7.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-debtcollector.spec ++++++ --- /var/tmp/diff_new_pack.gnc3nJ/_old 2015-09-03 18:12:41.000000000 +0200 +++ /var/tmp/diff_new_pack.gnc3nJ/_new 2015-09-03 18:12:41.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-debtcollector -Version: 0.5.0 +Version: 0.7.0 Release: 0 Summary: A collection of Python deprecation patterns and strategies that help you collect your technical debt in a non-destructive manner License: Apache-2.0 ++++++ debtcollector-0.5.0.tar.gz -> debtcollector-0.7.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/ChangeLog new/debtcollector-0.7.0/ChangeLog --- old/debtcollector-0.5.0/ChangeLog 2015-06-02 15:52:23.000000000 +0200 +++ new/debtcollector-0.7.0/ChangeLog 2015-08-03 19:19:38.000000000 +0200 @@ -1,6 +1,24 @@ CHANGES ======= +0.7.0 +----- + +* Updated from global requirements +* Expose a top level 'deprecate' function +* Add @removals.removed_kwarg on an __init__ method +* Improve + test keyword argument @classmethod removal +* Add example for removing a @classmethod + +0.6.0 +----- + +* Ensure doctesting and doc8 testing done in py27 env +* Updated from global requirements +* Fix quoting of examples +* Updated from global requirements +* Switch badges from 'pypip.in' to 'shields.io' + 0.5.0 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/PKG-INFO new/debtcollector-0.7.0/PKG-INFO --- old/debtcollector-0.5.0/PKG-INFO 2015-06-02 15:52:24.000000000 +0200 +++ new/debtcollector-0.7.0/PKG-INFO 2015-08-03 19:19:39.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: debtcollector -Version: 0.5.0 +Version: 0.7.0 Summary: A collection of Python deprecation patterns and strategies that help you collect your technical debt in a non-destructive manner. Home-page: http://www.openstack.org/ Author: OpenStack @@ -9,11 +9,11 @@ Description: Debtcollector ============= - .. image:: https://pypip.in/version/debtcollector/badge.svg + .. image:: https://img.shields.io/pypi/v/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Latest Version - .. image:: https://pypip.in/download/debtcollector/badge.svg?period=month + .. image:: https://img.shields.io/pypi/dm/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Downloads diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/README.rst new/debtcollector-0.7.0/README.rst --- old/debtcollector-0.5.0/README.rst 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/README.rst 2015-08-03 19:19:18.000000000 +0200 @@ -1,11 +1,11 @@ Debtcollector ============= -.. image:: https://pypip.in/version/debtcollector/badge.svg +.. image:: https://img.shields.io/pypi/v/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Latest Version -.. image:: https://pypip.in/download/debtcollector/badge.svg?period=month +.. image:: https://img.shields.io/pypi/dm/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Downloads diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector/__init__.py new/debtcollector-0.7.0/debtcollector/__init__.py --- old/debtcollector-0.5.0/debtcollector/__init__.py 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector/__init__.py 2015-08-03 19:19:18.000000000 +0200 @@ -14,6 +14,35 @@ import pbr.version +from debtcollector import _utils __version__ = pbr.version.VersionInfo( 'debtcollector').version_string() + + +def deprecate(prefix, postfix=None, message=None, + version=None, removal_version=None, + stacklevel=3, category=DeprecationWarning): + """Helper to deprecate some thing using generated message format. + + :param prefix: prefix string used as the prefix of the output message + :param postfix: postfix string used as the postfix of the output message + :param message: message string used as ending contents of the deprecate + message + :param version: version string (represents the version this + deprecation was created in) + :param removal_version: version string (represents the version this + deprecation will be removed in); a string of '?' + will denote this will be removed in some future + unknown version + :param stacklevel: stacklevel used in the :func:`warnings.warn` function + to locate where the users code is in the + :func:`warnings.warn` call + :param category: the :mod:`warnings` category to use, defaults to + :py:class:`DeprecationWarning` if not provided + """ + out_message = _utils.generate_message(prefix, postfix=postfix, + version=version, message=message, + removal_version=removal_version) + _utils.deprecation(out_message, stacklevel=stacklevel, + category=category) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector/removals.py new/debtcollector-0.7.0/debtcollector/removals.py --- old/debtcollector-0.5.0/debtcollector/removals.py 2015-06-02 15:52:02.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector/removals.py 2015-08-03 19:19:18.000000000 +0200 @@ -112,18 +112,14 @@ prefix, postfix=None, message=message, version=version, removal_version=removal_version) - def decorator(f): + @wrapt.decorator + def wrapper(f, instance, args, kwargs): + if old_name in kwargs: + _utils.deprecation(out_message, + stacklevel=stacklevel, category=category) + return f(*args, **kwargs) - @six.wraps(f) - def wrapper(*args, **kwargs): - if old_name in kwargs: - _utils.deprecation(out_message, - stacklevel=stacklevel, category=category) - return f(*args, **kwargs) - - return wrapper - - return decorator + return wrapper def removed_module(module, replacement=None, message=None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector/tests/test_deprecation.py new/debtcollector-0.7.0/debtcollector/tests/test_deprecation.py --- old/debtcollector-0.5.0/debtcollector/tests/test_deprecation.py 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector/tests/test_deprecation.py 2015-08-03 19:19:18.000000000 +0200 @@ -14,6 +14,7 @@ import warnings +import debtcollector from debtcollector import moves from debtcollector import removals from debtcollector import renames @@ -45,6 +46,11 @@ def berk(self): return self.bark + @removals.removed_kwarg('resp', message="Please use 'response' instead") + @classmethod + def factory(cls, resp=None, response=None): + return 'super-duper' + class KittyKat(object): @@ -131,6 +137,15 @@ category=PendingDeprecationWarning) +class DeprecateAnythingTest(test_base.TestCase): + def test_generation(self): + with warnings.catch_warnings(record=True) as capture: + warnings.simplefilter("always") + debtcollector.deprecate("Its broken") + debtcollector.deprecate("Its really broken") + self.assertEqual(2, len(capture)) + + class MovedInheritableClassTest(test_base.TestCase): def test_broken_type_class(self): self.assertRaises(TypeError, moves.moved_class, 'b', __name__) @@ -249,6 +264,18 @@ w = capture[0] self.assertEqual(DeprecationWarning, w.category) + def test_warnings_emitted_classmethod(self): + with warnings.catch_warnings(record=True) as capture: + warnings.simplefilter("always") + WoofWoof.factory(resp="hi") + self.assertEqual(1, len(capture)) + w = capture[0] + self.assertEqual(DeprecationWarning, w.category) + with warnings.catch_warnings(record=True) as capture: + warnings.simplefilter("always") + WoofWoof.factory(response="hi") + self.assertEqual(0, len(capture)) + def test_warnings_emitted_pending(self): with warnings.catch_warnings(record=True) as capture: warnings.simplefilter("always") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector.egg-info/PKG-INFO new/debtcollector-0.7.0/debtcollector.egg-info/PKG-INFO --- old/debtcollector-0.5.0/debtcollector.egg-info/PKG-INFO 2015-06-02 15:52:24.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector.egg-info/PKG-INFO 2015-08-03 19:19:38.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: debtcollector -Version: 0.5.0 +Version: 0.7.0 Summary: A collection of Python deprecation patterns and strategies that help you collect your technical debt in a non-destructive manner. Home-page: http://www.openstack.org/ Author: OpenStack @@ -9,11 +9,11 @@ Description: Debtcollector ============= - .. image:: https://pypip.in/version/debtcollector/badge.svg + .. image:: https://img.shields.io/pypi/v/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Latest Version - .. image:: https://pypip.in/download/debtcollector/badge.svg?period=month + .. image:: https://img.shields.io/pypi/dm/debtcollector.svg :target: https://pypi.python.org/pypi/debtcollector/ :alt: Downloads diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector.egg-info/pbr.json new/debtcollector-0.7.0/debtcollector.egg-info/pbr.json --- old/debtcollector-0.5.0/debtcollector.egg-info/pbr.json 2015-06-02 15:52:24.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector.egg-info/pbr.json 2015-08-03 19:19:38.000000000 +0200 @@ -1 +1 @@ -{"git_version": "8f4100a", "is_release": true} \ No newline at end of file +{"is_release": true, "git_version": "af91462"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/debtcollector.egg-info/requires.txt new/debtcollector-0.7.0/debtcollector.egg-info/requires.txt --- old/debtcollector-0.5.0/debtcollector.egg-info/requires.txt 2015-06-02 15:52:24.000000000 +0200 +++ new/debtcollector-0.7.0/debtcollector.egg-info/requires.txt 2015-08-03 19:19:38.000000000 +0200 @@ -1,4 +1,4 @@ -pbr>=0.11,<2.0 +pbr<2.0,>=1.3 Babel>=1.3 six>=1.9.0 wrapt>=1.7.0 # BSD License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/doc/source/api.rst new/debtcollector-0.7.0/doc/source/api.rst --- old/debtcollector-0.5.0/doc/source/api.rst 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/doc/source/api.rst 2015-08-03 19:19:18.000000000 +0200 @@ -12,6 +12,11 @@ to a **minimum** as they may be altered, refactored or moved to other locations **without** notice (and without the typical deprecation cycle). +Helpers +------- + +.. automodule:: debtcollector + Moves ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/doc/source/examples.rst new/debtcollector-0.7.0/doc/source/examples.rst --- old/debtcollector-0.5.0/doc/source/examples.rst 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/doc/source/examples.rst 2015-08-03 19:19:18.000000000 +0200 @@ -2,8 +2,8 @@ Examples ======== -Removing a class/method/function --------------------------------- +Removing a class/classmethod/method/function +-------------------------------------------- To signal to a user that a method (staticmethod, classmethod, or regular instance method) or a class or function is going to be removed at some point @@ -24,7 +24,12 @@ ... >>> c = Car() >>> c.start() - __main__:1: DeprecationWarning: Using function/method Car.start is deprecated + +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Using function/method 'Car.start()' is deprecated A basic example to do just this (on a class): @@ -38,7 +43,75 @@ ... pass ... >>> p = Pinto() - __main__:1: DeprecationWarning: Using class Pinto is deprecated + +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Using class 'Pinto' is deprecated + +A basic example to do just this (on a classmethod): + +.. doctest:: + + >>> from debtcollector import removals + >>> import warnings + >>> warnings.simplefilter("once") + >>> class OldAndBusted(object): + ... @removals.remove + ... @classmethod + ... def fix_things(cls): + ... pass + ... + >>> OldAndBusted.fix_things() + +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Using function/method 'OldAndBusted.fix_things()' is deprecated + +Removing a keyword argument +--------------------------- + +A basic example to do just this (on a classmethod): + +.. doctest:: + + >>> import warnings + >>> warnings.simplefilter("once") + >>> from debtcollector import removals + >>> class OldAndBusted(object): + ... @removals.removed_kwarg('resp', message="Please use 'response' instead") + ... @classmethod + ... def factory(cls, resp=None, response=None): + ... response = resp or response + ... return response + ... + >>> OldAndBusted.factory(resp='super-duper') + 'super-duper' + +.. testoutput:: + + __main__:1: DeprecationWarning: Using the 'resp' argument is deprecated: Please use 'response' instead + +A basic example to do just this (on a ``__init__`` method): + +.. doctest:: + + >>> import warnings + >>> warnings.simplefilter("once") + >>> from debtcollector import removals + >>> class OldAndBusted(object): + ... @removals.removed_kwarg('bleep') + ... def __init__(self, bleep=None): + ... self.bloop = bleep + ... + >>> o = OldAndBusted(bleep=2) + +.. testoutput:: + + __main__:1: DeprecationWarning: Using the 'bleep' argument is deprecated Moving a method --------------- @@ -63,11 +136,16 @@ ... >>> c = Cat() >>> c.mewow() - __main__:1: DeprecationWarning: Method 'Cat.mewow()' has moved to 'Cat.meow()' 'kitty' >>> c.meow() 'kitty' +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Method 'Cat.mewow()' has moved to 'Cat.meow()' + Moving a property ----------------- @@ -93,11 +171,16 @@ ... >>> d = Dog() >>> d.burk - __main__:1: DeprecationWarning: Property 'Dog.burk' has moved to 'Dog.bark' 'woof' >>> d.bark 'woof' +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Property 'Dog.burk' has moved to 'Dog.bark' + Moving a class -------------- @@ -117,9 +200,14 @@ ... >>> OldWizBang = moves.moved_class(WizBang, 'OldWizBang', __name__) >>> a = OldWizBang() - __main__:1: DeprecationWarning: Class '__main__.OldWizBang' has moved to '__main__.WizBang' >>> b = WizBang() +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Class '__main__.OldWizBang' has moved to '__main__.WizBang' + Renaming a keyword argument --------------------------- @@ -137,19 +225,20 @@ >>> warnings.simplefilter('always') >>> @renames.renamed_kwarg('snizzle', 'nizzle') ... def do_the_deed(snizzle=True, nizzle=True): - ... print(snizzle) - ... print(nizzle) + ... return (snizzle, nizzle) ... >>> do_the_deed() - True - True + (True, True) >>> do_the_deed(snizzle=False) - __main__:1: DeprecationWarning: Using the 'snizzle' argument is deprecated, please use the 'nizzle' argument instead - False - True + (False, True) >>> do_the_deed(nizzle=False) - True - False + (True, False) + +**Expected output:** + +.. testoutput:: + + __main__:1: DeprecationWarning: Using the 'snizzle' argument is deprecated, please use the 'nizzle' argument instead Further customizing the emitted messages ---------------------------------------- @@ -173,6 +262,11 @@ ... pass ... >>> do_the_deed(snizzle=False) + +**Expected output:** + +.. testoutput:: + __main__:1: DeprecationWarning: Using the 'snizzle' argument is deprecated in version '0.5' and will be removed in version '0.7', please use the 'nizzle' argument instead If the ``removal_version`` is unknown the special character ``?`` can be used @@ -191,6 +285,11 @@ ... pass ... >>> do_the_deed(snizzle=False) + +**Expected output:** + +.. testoutput:: + __main__:1: DeprecationWarning: Using the 'snizzle' argument is deprecated in version '0.5' and will be removed in a future version, please use the 'nizzle' argument instead To further customize the message (with a special postfix) the ``message`` @@ -208,4 +307,30 @@ ... pass ... >>> do_the_deed(snizzle=False) + +**Expected output:** + +.. testoutput:: + __main__:1: DeprecationWarning: Using the 'snizzle' argument is deprecated, please use the 'nizzle' argument instead: Pretty please stop using it + +Deprecating anything else +------------------------- + +For use-cases which do not fit the above decorators, properties other +provided functionality the final option is to use debtcollectors +the :py:func:`~debtcollector.deprecate` function to make your own +messages (using the message building logic that debtcollector uses itself). + +A basic example to do just this: + +.. doctest:: + + >>> import warnings + >>> warnings.simplefilter("always") + >>> import debtcollector + >>> debtcollector.deprecate("This is no longer supported", version="1.0") + +.. testoutput:: + + __main__:1: DeprecationWarning: This is no longer supported in version '1.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/requirements.txt new/debtcollector-0.7.0/requirements.txt --- old/debtcollector-0.5.0/requirements.txt 2015-06-02 15:52:02.000000000 +0200 +++ new/debtcollector-0.7.0/requirements.txt 2015-08-03 19:19:18.000000000 +0200 @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=0.11,<2.0 +pbr<2.0,>=1.3 Babel>=1.3 six>=1.9.0 wrapt>=1.7.0 # BSD License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/setup.cfg new/debtcollector-0.7.0/setup.cfg --- old/debtcollector-0.5.0/setup.cfg 2015-06-02 15:52:24.000000000 +0200 +++ new/debtcollector-0.7.0/setup.cfg 2015-08-03 19:19:39.000000000 +0200 @@ -36,7 +36,7 @@ universal = 1 [egg_info] +tag_build = tag_svn_revision = 0 tag_date = 0 -tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/setup.py new/debtcollector-0.7.0/setup.py --- old/debtcollector-0.5.0/setup.py 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/setup.py 2015-08-03 19:19:18.000000000 +0200 @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,5 +25,5 @@ pass setuptools.setup( - setup_requires=['pbr'], + setup_requires=['pbr>=1.3'], pbr=True) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/test-requirements.txt new/debtcollector-0.7.0/test-requirements.txt --- old/debtcollector-0.5.0/test-requirements.txt 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/test-requirements.txt 2015-08-03 19:19:18.000000000 +0200 @@ -7,9 +7,9 @@ coverage>=3.6 discover python-subunit>=0.0.18 -sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 -oslosphinx>=2.5.0 # Apache-2.0 -oslotest>=1.5.1 # Apache-2.0 +sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 +oslosphinx>=2.5.0 # Apache-2.0 +oslotest>=1.9.0 # Apache-2.0 testrepository>=0.0.18 testscenarios>=0.4 -testtools>=0.9.36,!=1.2.0 +testtools>=1.4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/debtcollector-0.5.0/tox.ini new/debtcollector-0.7.0/tox.ini --- old/debtcollector-0.5.0/tox.ini 2015-06-02 15:52:01.000000000 +0200 +++ new/debtcollector-0.7.0/tox.ini 2015-08-03 19:19:18.000000000 +0200 @@ -24,9 +24,16 @@ [testenv:docs] commands = python setup.py build_sphinx +[testenv:py27] +deps = {[testenv]deps} + doc8 +commands = + python setup.py testr --slowest --testr-args='{posargs}' + sphinx-build -b doctest doc/source doc/build + doc8 doc/source + [flake8] # E123, E125 skipped as they are invalid PEP-8. - show-source = True ignore = E123,E125 builtins = _