Hello community, here is the log from the commit of package python3-extras for openSUSE:Factory checked in at 2016-07-14 09:47:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-extras (Old) and /work/SRC/openSUSE:Factory/.python3-extras.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python3-extras" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-extras/python3-extras.changes 2016-05-25 21:24:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python3-extras.new/python3-extras.changes 2016-07-14 09:47:29.000000000 +0200 @@ -1,0 +2,7 @@ +Sat Jul 9 16:13:31 UTC 2016 - arun@gmx.de + +- update to version 1.0.0: + * Imports in the middle of import cycles are now supported. (Robert + Collins) + +------------------------------------------------------------------- @@ -7 +13,0 @@ - Old: ---- extras-0.0.3.tar.gz New: ---- extras-1.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-extras.spec ++++++ --- /var/tmp/diff_new_pack.meYt2W/_old 2016-07-14 09:47:30.000000000 +0200 +++ /var/tmp/diff_new_pack.meYt2W/_new 2016-07-14 09:47:30.000000000 +0200 @@ -21,7 +21,7 @@ %bcond_with tests Name: python3-extras -Version: 0.0.3 +Version: 1.0.0 Release: 0 Summary: Useful extra bits for Python License: MIT ++++++ extras-0.0.3.tar.gz -> extras-1.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/NEWS new/extras-1.0.0/NEWS --- old/extras-0.0.3/NEWS 2013-01-21 19:24:35.000000000 +0100 +++ new/extras-1.0.0/NEWS 2016-05-18 11:10:58.000000000 +0200 @@ -6,6 +6,12 @@ NEXT ~~~~ +1.0.0 +~~~~~ + +* Imports in the middle of import cycles are now supported. + (Robert Collins) + 0.0.3 ~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/PKG-INFO new/extras-1.0.0/PKG-INFO --- old/extras-0.0.3/PKG-INFO 2013-01-21 19:26:30.000000000 +0100 +++ new/extras-1.0.0/PKG-INFO 2016-05-18 11:18:10.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: extras -Version: 0.0.3 +Version: 1.0.0 Summary: Useful extra bits for Python - things that shold be in the standard library Home-page: https://github.com/testing-cabal/extras Author: Testing cabal @@ -65,4 +65,7 @@ * Martin Pool Platform: UNKNOWN +Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/extras/__init__.py new/extras-1.0.0/extras/__init__.py --- old/extras-0.0.3/extras/__init__.py 2013-01-21 19:24:49.000000000 +0100 +++ new/extras-1.0.0/extras/__init__.py 2016-05-18 11:11:11.000000000 +0200 @@ -22,7 +22,7 @@ # If the releaselevel is 'final', then the tarball will be major.minor.micro. # Otherwise it is major.minor.micro~$(revno). -__version__ = (0, 0, 3, 'final', 0) +__version__ = (1, 0, 0, 'final', 0) def try_import(name, alternative=None, error_callback=None): @@ -40,13 +40,17 @@ """ module_segments = name.split('.') last_error = None + remainder = [] + # module_name will be what successfully imports. We cannot walk from the + # __import__ result because in import loops (A imports A.B, which imports + # C, which calls try_import("A.B")) A.B will not yet be set. while module_segments: module_name = '.'.join(module_segments) try: - module = __import__(module_name) + __import__(module_name) except ImportError: last_error = sys.exc_info()[1] - module_segments.pop() + remainder.append(module_segments.pop()) continue else: break @@ -54,8 +58,9 @@ if last_error is not None and error_callback is not None: error_callback(last_error) return alternative + module = sys.modules[module_name] nonexistent = object() - for segment in name.split('.')[1:]: + for segment in reversed(remainder): module = getattr(module, segment, nonexistent) if module is nonexistent: if last_error is not None and error_callback is not None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/extras/tests/test_extras.py new/extras-1.0.0/extras/tests/test_extras.py --- old/extras-0.0.3/extras/tests/test_extras.py 2012-10-27 11:27:24.000000000 +0200 +++ new/extras-1.0.0/extras/tests/test_extras.py 2016-05-18 08:53:49.000000000 +0200 @@ -1,5 +1,8 @@ # Copyright (c) 2010-2012 extras developers. See LICENSE for details. +import sys +import types + from testtools import TestCase from testtools.matchers import ( Equals, @@ -125,6 +128,22 @@ # the error callback is not called on success. check_error_callback(self, try_import, 'os.path', 0, True) + def test_handle_partly_imported_name(self): + # try_import('thing.other') when thing.other is mid-import + # used to fail because thing.other is not assigned until thing.other + # finishes its import - but thing.other is accessible via sys.modules. + outer = types.ModuleType("extras.outer") + inner = types.ModuleType("extras.outer.inner") + inner.attribute = object() + self.addCleanup(sys.modules.pop, "extras.outer", None) + self.addCleanup(sys.modules.pop, "extras.outer.inner", None) + sys.modules["extras.outer"] = outer + sys.modules["extras.outer.inner"] = inner + result = try_import("extras.outer.inner.attribute") + self.expectThat(result, Is(inner.attribute)) + result = try_import("extras.outer.inner") + self.expectThat(result, Is(inner)) + class TestTryImports(TestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/extras.egg-info/PKG-INFO new/extras-1.0.0/extras.egg-info/PKG-INFO --- old/extras-0.0.3/extras.egg-info/PKG-INFO 2013-01-21 19:26:30.000000000 +0100 +++ new/extras-1.0.0/extras.egg-info/PKG-INFO 2016-05-18 11:18:10.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: extras -Version: 0.0.3 +Version: 1.0.0 Summary: Useful extra bits for Python - things that shold be in the standard library Home-page: https://github.com/testing-cabal/extras Author: Testing cabal @@ -65,4 +65,7 @@ * Martin Pool Platform: UNKNOWN +Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/extras.egg-info/SOURCES.txt new/extras-1.0.0/extras.egg-info/SOURCES.txt --- old/extras-0.0.3/extras.egg-info/SOURCES.txt 2013-01-21 19:26:30.000000000 +0100 +++ new/extras-1.0.0/extras.egg-info/SOURCES.txt 2016-05-18 11:18:10.000000000 +0200 @@ -10,6 +10,7 @@ extras.egg-info/PKG-INFO extras.egg-info/SOURCES.txt extras.egg-info/dependency_links.txt +extras.egg-info/pbr.json extras.egg-info/top_level.txt extras/tests/__init__.py extras/tests/test_extras.py \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/extras.egg-info/pbr.json new/extras-1.0.0/extras.egg-info/pbr.json --- old/extras-0.0.3/extras.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 +++ new/extras-1.0.0/extras.egg-info/pbr.json 2015-10-25 02:31:17.000000000 +0100 @@ -0,0 +1 @@ +{"is_release": false, "git_version": "cdeb596"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/setup.cfg new/extras-1.0.0/setup.cfg --- old/extras-0.0.3/setup.cfg 2013-01-21 19:26:30.000000000 +0100 +++ new/extras-1.0.0/setup.cfg 2016-05-18 11:18:10.000000000 +0200 @@ -3,6 +3,9 @@ buffer = 1 catch = 1 +[bdist_wheel] +universal = 1 + [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/extras-0.0.3/setup.py new/extras-1.0.0/setup.py --- old/extras-0.0.3/setup.py 2013-01-21 19:23:09.000000000 +0100 +++ new/extras-1.0.0/setup.py 2014-09-19 08:46:27.000000000 +0200 @@ -35,7 +35,12 @@ 'in the standard library'), long_description=get_long_description(), version=get_version(), - classifiers=["License :: OSI Approved :: MIT License"], + classifiers=[ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + ], packages=[ 'extras', 'extras.tests',