Hello community, here is the log from the commit of package python-orderedmultidict for openSUSE:Factory checked in at 2019-07-28 10:17:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-orderedmultidict (Old) and /work/SRC/openSUSE:Factory/.python-orderedmultidict.new.4126 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-orderedmultidict" Sun Jul 28 10:17:52 2019 rev:2 rq:717900 version:1.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-orderedmultidict/python-orderedmultidict.changes 2019-03-22 15:01:04.853798832 +0100 +++ /work/SRC/openSUSE:Factory/.python-orderedmultidict.new.4126/python-orderedmultidict.changes 2019-07-28 10:17:57.544600911 +0200 @@ -1,0 +2,8 @@ +Tue Jul 23 13:36:15 UTC 2019 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.0.1: + * Imports overhaul + * py 3.8 support + * More tests + +------------------------------------------------------------------- Old: ---- orderedmultidict-1.0.tar.gz New: ---- orderedmultidict-1.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-orderedmultidict.spec ++++++ --- /var/tmp/diff_new_pack.oSF38P/_old 2019-07-28 10:17:59.060600970 +0200 +++ /var/tmp/diff_new_pack.oSF38P/_new 2019-07-28 10:17:59.064600971 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-orderedmultidict -Version: 1.0 +Version: 1.0.1 Release: 0 Summary: Ordered Multivalue Dictionary License: Unlicense @@ -40,7 +40,7 @@ %prep %setup -q -n orderedmultidict-%{version} -sed -i 's/^.*pycodestyle.*/tests_require = []/' setup.py +sed -i 's/^.*flake8.*/tests_require = []/' setup.py chmod a-x README.md LICENSE.md rm -r *.egg-info ++++++ orderedmultidict-1.0.tar.gz -> orderedmultidict-1.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/LICENSE.md new/orderedmultidict-1.0.1/LICENSE.md --- old/orderedmultidict-1.0/LICENSE.md 2018-01-17 08:07:15.000000000 +0100 +++ new/orderedmultidict-1.0.1/LICENSE.md 2018-06-28 07:29:05.000000000 +0200 @@ -28,4 +28,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\ SOFTWARE. -For more information, please refer to <http://unlicense.org/> +For more information, please refer to <https://unlicense.org/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/PKG-INFO new/orderedmultidict-1.0.1/PKG-INFO --- old/orderedmultidict-1.0/PKG-INFO 2018-06-12 05:55:46.000000000 +0200 +++ new/orderedmultidict-1.0.1/PKG-INFO 2019-07-10 22:11:44.000000000 +0200 @@ -1,7 +1,7 @@ Metadata-Version: 1.1 Name: orderedmultidict -Version: 1.0 -Summary: Ordered Multivalue Dictionary - omdict. +Version: 1.0.1 +Summary: Ordered Multivalue Dictionary Home-page: https://github.com/gruns/orderedmultidict Author: Ansgar Grunseid Author-email: gruns...@gmail.com @@ -20,9 +20,12 @@ Classifier: License :: Freely Distributable Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable +Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: Implementation :: PyPy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/README.md new/orderedmultidict-1.0.1/README.md --- old/orderedmultidict-1.0/README.md 2018-01-17 08:08:32.000000000 +0100 +++ new/orderedmultidict-1.0.1/README.md 2018-10-17 00:18:13.000000000 +0200 @@ -1,15 +1,24 @@ -# orderedmultidict +<h1 align="center"> + <div> + <img src="logo.svg" width="300px" height="300px" alt="orderedmultidict"> + </div> + orderedmultidict +</h1> + +<p align="center"> + <a href="https://pypi.python.org/pypi/orderedmultidict"><img src="https://badge.fury.io/py/orderedmultidict.svg"></a> + <a href="https://travis-ci.org/gruns/orderedmultidict"><img src="https://api.travis-ci.org/gruns/orderedmultidict.svg"></a> + <a href="http://unlicense.org/"><img src="https://img.shields.io/pypi/l/orderedmultidict.svg"></a> + <a href="https://pypi.python.org/pypi/orderedmultidict"><img src="https://img.shields.io/pypi/pyversions/orderedmultidict.svg"></a> +</p> -[![Badge fury](https://badge.fury.io/py/orderedmultidict.svg)](https://pypi.python.org/pypi/orderedmultidict) -[![Build status](https://api.travis-ci.org/gruns/orderedmultidict.svg)](https://travis-ci.org/gruns/orderedmultidict) - -### omdict is an ordered multivalue dictionary that retains method parity with Python's [dict](http://docs.python.org/library/stdtypes.html#dict). +### omdict is an ordered multivalue dictionary that retains<br>method parity with Python's [dict](http://docs.python.org/library/stdtypes.html#dict) and helps power [furl](https://github.com/gruns/furl). A multivalue dictionary is a dictionary that can store multiple values per\ key. An ordered multivalue dictionary is a multivalue dictionary that\ retains the order of insertions and deletions. -orderedmultidict is well tested, [Unlicensed](http://unlicense.org/) in the public domain, and\ +orderedmultidict is well tested, [Unlicensed](http://unlicense.org/) in the public domain,\ supports Python 2, Python 3, PyPy2, and PyPy3. Code time: omdict can store multiple values per key. @@ -43,7 +52,7 @@ [(2, 'sup'), (1, 1)] ``` -Method parity with dict is retained. omdict can be a drop-in replacement. +Method parity with dict is retained; omdict can be a drop-in replacement. ```python >>> d, omd = dict(), omdict() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict/__init__.py new/orderedmultidict-1.0.1/orderedmultidict/__init__.py --- old/orderedmultidict-1.0/orderedmultidict/__init__.py 2018-06-12 04:37:39.000000000 +0200 +++ new/orderedmultidict-1.0.1/orderedmultidict/__init__.py 2019-01-08 07:54:23.000000000 +0100 @@ -8,14 +8,14 @@ # gruns...@gmail.com # # License: Build Amazing Things (Unlicense) +# -from __future__ import absolute_import +from os.path import dirname, join as pjoin from .orderedmultidict import * # noqa -__title__ = 'orderedmultidict' -__version__ = '1.0' -__author__ = 'Ansgar Grunseid' -__contact__ = 'gruns...@gmail.com' -__license__ = 'Unlicense' -__url__ = 'https://github.com/gruns/orderedmultidict' +# Import all variables in __version__.py without explicit imports. +meta = {} +with open(pjoin(dirname(__file__), '__version__.py')) as f: + exec(f.read(), meta) +globals().update(dict((k, v) for k, v in meta.items() if k not in globals())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict/__version__.py new/orderedmultidict-1.0.1/orderedmultidict/__version__.py --- old/orderedmultidict-1.0/orderedmultidict/__version__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/orderedmultidict-1.0.1/orderedmultidict/__version__.py 2019-07-10 22:02:25.000000000 +0200 @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +# +# omdict - Ordered Multivalue Dictionary. +# +# Ansgar Grunseid +# grunseid.com +# gruns...@gmail.com +# +# License: Build Amazing Things (Unlicense) +# + +__title__ = 'orderedmultidict' +__version__ = '1.0.1' +__license__ = 'Unlicense' +__author__ = 'Ansgar Grunseid' +__contact__ = 'gruns...@gmail.com' +__description__ = 'Ordered Multivalue Dictionary' +__url__ = 'https://github.com/gruns/orderedmultidict' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict/itemlist.py new/orderedmultidict-1.0.1/orderedmultidict/itemlist.py --- old/orderedmultidict-1.0/orderedmultidict/itemlist.py 2018-05-26 16:46:20.000000000 +0200 +++ new/orderedmultidict-1.0.1/orderedmultidict/itemlist.py 2019-01-08 07:54:17.000000000 +0100 @@ -8,6 +8,7 @@ # gruns...@gmail.com # # License: Build Amazing Things (Unlicense) +# from __future__ import absolute_import diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict/orderedmultidict.py new/orderedmultidict-1.0.1/orderedmultidict/orderedmultidict.py --- old/orderedmultidict-1.0/orderedmultidict/orderedmultidict.py 2018-05-29 22:28:34.000000000 +0200 +++ new/orderedmultidict-1.0.1/orderedmultidict/orderedmultidict.py 2019-07-10 22:04:45.000000000 +0200 @@ -8,26 +8,30 @@ # gruns...@gmail.com # # License: Build Amazing Things (Unlicense) +# from __future__ import absolute_import +import sys from itertools import chain -from collections import MutableMapping import six from six.moves import map, zip_longest from .itemlist import itemlist +if six.PY2: + from collections import MutableMapping +else: + from collections.abc import MutableMapping try: from collections import OrderedDict as odict # Python 2.7 and later. except ImportError: from ordereddict import OrderedDict as odict # Python 2.6 and earlier. -import sys -items_attr = 'items' if sys.version_info[0] >= 3 else 'iteritems' _absent = object() # Marker that means no parameter was provided. +_items_attr = 'items' if sys.version_info[0] >= 3 else 'iteritems' def callable_attr(obj, attr): @@ -765,7 +769,7 @@ for i1, i2 in zip_longest(myiter, otheriter, fillvalue=_absent): if i1 != i2 or i1 is _absent or i2 is _absent: return False - elif not hasattr(other, '__len__') or not hasattr(other, items_attr): + elif not hasattr(other, '__len__') or not hasattr(other, _items_attr): return False # Ignore order so we can compare ordered omdicts with unordered dicts. else: @@ -809,3 +813,21 @@ def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.allitems()) + + def __or__(self, other): + return self.__class__(chain(_get_items(self), _get_items(other))) + + def __ior__(self, other): + for k, v in _get_items(other): + self.add(k, value=v) + return self + + +def _get_items(mapping): + """Find item iterator for an object.""" + names = ('iterallitems', 'allitems', 'iteritems', 'items') + exist = (n for n in names if callable_attr(mapping, n)) + for a in exist: + return getattr(mapping, a)() + raise TypeError( + "Object {} has no compatible items interface.".format(mapping)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict.egg-info/PKG-INFO new/orderedmultidict-1.0.1/orderedmultidict.egg-info/PKG-INFO --- old/orderedmultidict-1.0/orderedmultidict.egg-info/PKG-INFO 2018-06-12 05:55:46.000000000 +0200 +++ new/orderedmultidict-1.0.1/orderedmultidict.egg-info/PKG-INFO 2019-07-10 22:11:44.000000000 +0200 @@ -1,7 +1,7 @@ Metadata-Version: 1.1 Name: orderedmultidict -Version: 1.0 -Summary: Ordered Multivalue Dictionary - omdict. +Version: 1.0.1 +Summary: Ordered Multivalue Dictionary Home-page: https://github.com/gruns/orderedmultidict Author: Ansgar Grunseid Author-email: gruns...@gmail.com @@ -20,9 +20,12 @@ Classifier: License :: Freely Distributable Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable +Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: Implementation :: PyPy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/orderedmultidict.egg-info/SOURCES.txt new/orderedmultidict-1.0.1/orderedmultidict.egg-info/SOURCES.txt --- old/orderedmultidict-1.0/orderedmultidict.egg-info/SOURCES.txt 2018-06-12 05:55:46.000000000 +0200 +++ new/orderedmultidict-1.0.1/orderedmultidict.egg-info/SOURCES.txt 2019-07-10 22:11:44.000000000 +0200 @@ -2,8 +2,10 @@ LICENSE.md MANIFEST.in README.md +setup.cfg setup.py orderedmultidict/__init__.py +orderedmultidict/__version__.py orderedmultidict/itemlist.py orderedmultidict/orderedmultidict.py orderedmultidict.egg-info/PKG-INFO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/setup.cfg new/orderedmultidict-1.0.1/setup.cfg --- old/orderedmultidict-1.0/setup.cfg 2018-06-12 05:55:46.000000000 +0200 +++ new/orderedmultidict-1.0.1/setup.cfg 2019-07-10 22:11:44.000000000 +0200 @@ -1,3 +1,9 @@ +[bdist_wheel] +universal = 1 + +[metadata] +license_file = LICENSE.md + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/setup.py new/orderedmultidict-1.0.1/setup.py --- old/orderedmultidict-1.0/setup.py 2018-05-26 16:46:20.000000000 +0200 +++ new/orderedmultidict-1.0.1/setup.py 2018-12-11 02:30:26.000000000 +0100 @@ -11,16 +11,15 @@ # License: Build Amazing Things (Unlicense) import os -import re import sys from os.path import dirname, join as pjoin from setuptools import setup, find_packages, Command from setuptools.command.test import test as TestCommand -with open(pjoin(dirname(__file__), 'orderedmultidict', '__init__.py')) as fd: - VERSION = re.compile( - r".*__version__ = '(.*?)'", re.S).match(fd.read()).group(1) +meta = {} +with open(pjoin('orderedmultidict', '__version__.py')) as f: + exec(f.read(), meta) class Publish(Command): @@ -34,9 +33,13 @@ pass def run(self): - os.system('python setup.py sdist') - rc = os.system( - 'twine upload dist/orderedmultidict-%s.tar.gz' % VERSION) + os.system('python setup.py sdist bdist_wheel') + + base = 'dist/orderedmultidict' + sdist = '%s-%s.tar.gz' % (base, meta['__version__']) + wheel = '%s-%s-py2.py3-none-any.whl' % (base, meta['__version__']) + rc = os.system('twine upload "%s" "%s"' % (sdist, wheel)) + sys.exit(rc) @@ -75,18 +78,18 @@ if sys.version_info < (2, 7): required.append('ordereddict') -tests_require = ['pycodestyle'] +tests_require = ['flake8'] if sys.version_info[:2] < (2, 7): tests_require += ['unittest2'] setup( - name='orderedmultidict', - version=VERSION, - author='Ansgar Grunseid', - author_email='gruns...@gmail.com', - url='https://github.com/gruns/orderedmultidict', - license='Unlicense', - description='Ordered Multivalue Dictionary - omdict.', + name=meta['__title__'], + version=meta['__version__'], + author=meta['__author__'], + author_email=meta['__contact__'], + url=meta['__url__'], + license=meta['__license__'], + description=meta['__description__'], long_description=long_description, packages=find_packages(), include_package_data=True, @@ -97,11 +100,14 @@ 'License :: Freely Distributable', 'Intended Audience :: Developers', 'Development Status :: 5 - Production/Stable', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: PyPy', ], install_requires=required, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/tests/test_itemlist.py new/orderedmultidict-1.0.1/tests/test_itemlist.py --- old/orderedmultidict-1.0/tests/test_itemlist.py 2018-05-26 16:46:20.000000000 +0200 +++ new/orderedmultidict-1.0.1/tests/test_itemlist.py 2019-01-08 07:54:36.000000000 +0100 @@ -8,6 +8,7 @@ # gruns...@gmail.com # # License: Build Amazing Things (Unlicense) +# from __future__ import absolute_import diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orderedmultidict-1.0/tests/test_orderedmultidict.py new/orderedmultidict-1.0.1/tests/test_orderedmultidict.py --- old/orderedmultidict-1.0/tests/test_orderedmultidict.py 2018-05-26 16:46:20.000000000 +0200 +++ new/orderedmultidict-1.0.1/tests/test_orderedmultidict.py 2019-07-10 22:11:37.000000000 +0200 @@ -8,6 +8,7 @@ # gruns...@gmail.com # # License: Build Amazing Things (Unlicense) +# from __future__ import absolute_import @@ -26,6 +27,15 @@ _unique = object() + +def callable_attr(o, attr): + return hasattr(o, attr) and callable(getattr(o, attr)) + + +def is_iterator(i): + return callable_attr(i, 'next') or callable_attr(i, '__next__') + + # Utility list subclass to expose items() and iteritems() methods on basic # lists. This provides a common iteration interface for lists and dictionaries # for looping through their items without having to test for and maintain two @@ -530,14 +540,19 @@ assert listitem == (key, valuelist) # Testing iteritems(), iterkeys(), itervalues(), and iterlists(). + assert is_iterator(omd.iterkeys()) for key1, key2 in zip(omd.iterkeys(), six.iterkeys(dic)): assert key1 == key2 + assert is_iterator(omd.itervalues()) for val1, val2 in zip(omd.itervalues(), six.itervalues(dic)): assert val1 == val2 + assert is_iterator(omd.iteritems()) for item1, item2 in zip(omd.iteritems(), six.iteritems(dic)): assert item1 == item2 + assert is_iterator(omd.iterlists()) for key, values in zip(six.iterkeys(omd), omd.iterlists()): assert omd.getlist(key) == values + assert is_iterator(omd.iterlistitems()) iterator = zip( omd.iterkeys(), omd.iterlists(), omd.iterlistitems()) for key, valuelist, listitem in iterator: @@ -545,10 +560,11 @@ # Test iteritems() and itervalues() with a key. for key in omd.iterkeys(): + assert is_iterator(omd.iteritems(key)) assert list(omd.iteritems(key)) == list(zip( repeat(key), omd.getlist(key))) - assert list(omd.iterallitems(key)) == list(zip( - repeat(key), omd.getlist(key))) + assert is_iterator(omd.itervalues(key)) + assert list(omd.itervalues(key)) == omd.getlist(key) for nonkey in self.nonkeys: self.assertRaises(KeyError, omd.iteritems, nonkey) self.assertRaises(KeyError, omd.itervalues, nonkey) @@ -824,6 +840,46 @@ assert splat(*omd, **omd) == (tuple(i[0] for i in items), set(items)) +class TestBinaryOperators(unittest.TestCase): + + @property + def _items(self): + original = (1, ['a']), (2, 'b') + one_different = (1, ['a']), (3, 'd') + all_different = (1, 'c'), (3, 'd') + duplicate_key = (1, ['a']), (1, 'e') + empty = tuple() + return original, one_different, all_different, duplicate_key, empty + + @property + def _or_params(self): + original, one_diff, all_diff, duplicate_key, empty = self._items + return [ + # self, other, other as dict, other as omdict. + (original, original, original + original, original + original), + (original, one_diff, original + one_diff, original + one_diff), + (original, all_diff, original + all_diff, original + all_diff), + (original, duplicate_key, original + ((1, 'e'),), original + duplicate_key), + (original, empty, original, original), + ] + + def test_or(self): + for s, t, d, o in self._or_params: + assert omdict(s) | dict(t) == omdict(d) + assert omdict(s) | omdict(t) == omdict(o) + + def test_ior(self): + for s, t, d, o in self._or_params: + # Test with dict. + a = omdict(s) + a |= dict(t) + assert a == omdict(d) + # Test with omdict. + a = omdict(s) + a |= omdict(t) + assert a == omdict(o) + + class TestUtilities(unittest.TestCase): def test_rfind(self):