4 new commits in py: https://bitbucket.org/hpk42/py/commits/0973095b4ffe/ Changeset: 0973095b4ffe User: hpk42 Date: 2014-08-04 13:10:59 Summary: use newer apipkg version which makes attribute access on alias modules resolve to None rather than an ImportError. This helps with code that uses inspect.getframeinfo() on py34 which causes a complete walk on sys.modules thus triggering the alias module to resolve and blowing up with ImportError. The negative side is that something like "py.test.X" will now result in None instead of "importerror: pytest" if pytest is not installed. But you shouldn't import "py.test" anyway anymore. Affected #: 3 files
diff -r 37f557844498ef4943c1e68c8f40bc3713b0b393 -r 0973095b4ffec521e3f9ba94dd6c6b0d6c84a6e4 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,17 @@ +1.4.23 +================================================== + +- use newer apipkg version which makes attribute access on + alias modules resolve to None rather than an ImportError. + This helps with code that uses inspect.getframeinfo() + on py34 which causes a complete walk on sys.modules + thus triggering the alias module to resolve and blowing + up with ImportError. The negative side is that something + like "py.test.X" will now result in None instead of "importerror: pytest" + if pytest is not installed. But you shouldn't import "py.test" + anyway anymore. + + 1.4.22 ================================================== diff -r 37f557844498ef4943c1e68c8f40bc3713b0b393 -r 0973095b4ffec521e3f9ba94dd6c6b0d6c84a6e4 py/_apipkg.py --- a/py/_apipkg.py +++ b/py/_apipkg.py @@ -17,6 +17,7 @@ that will leave paths from jython jars alone """ if path.startswith('__pyclasspath__'): + return path else: return os.path.abspath(path) @@ -41,7 +42,7 @@ if hasattr(oldmod, "__dict__"): oldmod.__dict__.update(d) mod = ApiModule(pkgname, exportdefs, implprefix=pkgname, attr=d) - sys.modules[pkgname] = mod + sys.modules[pkgname] = mod def importobj(modpath, attrname): module = __import__(modpath, None, None, ['__doc__']) @@ -72,11 +73,11 @@ self.__implprefix__ = implprefix or name if attr: for name, val in attr.items(): - #print "setting", self.__name__, name, val + # print "setting", self.__name__, name, val setattr(self, name, val) for name, importspec in importspec.items(): if isinstance(importspec, dict): - subname = '%s.%s'%(self.__name__, name) + subname = '%s.%s' % (self.__name__, name) apimod = ApiModule(subname, importspec, implprefix) sys.modules[subname] = apimod setattr(self, name, apimod) @@ -88,7 +89,7 @@ modpath = implprefix + modpath if not attrname: - subname = '%s.%s'%(self.__name__, name) + subname = '%s.%s' % (self.__name__, name) apimod = AliasModule(subname, modpath) sys.modules[subname] = apimod if '.' not in name: @@ -108,7 +109,7 @@ def __makeattr(self, name): """lazily compute value for name or raise AttributeError if unknown.""" - #print "makeattr", self.__name__, name + # print "makeattr", self.__name__, name target = None if '__onfirstaccess__' in self.__map__: target = self.__map__.pop('__onfirstaccess__') @@ -126,7 +127,7 @@ try: del self.__map__[name] except KeyError: - pass # in a recursive-import situation a double-del can happen + pass # in a recursive-import situation a double-del can happen return result __getattr__ = __makeattr @@ -166,7 +167,10 @@ return '<AliasModule %r for %r>' % (modname, x) def __getattribute__(self, name): - return getattr(getmod(), name) + try: + return getattr(getmod(), name) + except ImportError: + return None def __setattr__(self, name, value): setattr(getmod(), name, value) diff -r 37f557844498ef4943c1e68c8f40bc3713b0b393 -r 0973095b4ffec521e3f9ba94dd6c6b0d6c84a6e4 tox.ini --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=py26,py27,py32,py33,external +envlist=py26,py27,py33,py34,external # py27-xdist causes problems with svn, py25 requires virtualenv==1.9.1 #indexserver= # default=http://pypi.testrun.org https://bitbucket.org/hpk42/py/commits/ff73ae3a4b47/ Changeset: ff73ae3a4b47 User: hpk42 Date: 2014-08-04 13:15:48 Summary: adapt one svn test to only check for any exception instead of specific ones because different svn versions cause different errors and we don't care. Affected #: 2 files diff -r 0973095b4ffec521e3f9ba94dd6c6b0d6c84a6e4 -r ff73ae3a4b473d995d09a3ad69062af22a33d624 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -11,6 +11,10 @@ if pytest is not installed. But you shouldn't import "py.test" anyway anymore. +- adapt one svn test to only check for any exception instead + of specific ones because different svn versions cause different + errors and we don't care. + 1.4.22 ================================================== diff -r 0973095b4ffec521e3f9ba94dd6c6b0d6c84a6e4 -r ff73ae3a4b473d995d09a3ad69062af22a33d624 testing/path/test_svnwc.py --- a/testing/path/test_svnwc.py +++ b/testing/path/test_svnwc.py @@ -338,7 +338,7 @@ somefile = root.join('somefile') somefile.ensure(file=True) # not yet added to repo - py.test.raises((py.process.cmdexec.Error, ValueError), 'somefile.lock()') + py.test.raises(Exception, 'somefile.lock()') somefile.write('foo') somefile.commit('test') assert somefile.check(versioned=True) https://bitbucket.org/hpk42/py/commits/01ae2cfcc61c/ Changeset: 01ae2cfcc61c User: hpk42 Date: 2014-08-04 13:16:34 Summary: prepare 1.4.23 Affected #: 2 files diff -r ff73ae3a4b473d995d09a3ad69062af22a33d624 -r 01ae2cfcc61c4fcb3aa5031349adb5b467c31018 py/__init__.py --- a/py/__init__.py +++ b/py/__init__.py @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2013 """ -__version__ = '1.4.22' +__version__ = '1.4.23' from py import _apipkg diff -r ff73ae3a4b473d995d09a3ad69062af22a33d624 -r 01ae2cfcc61c4fcb3aa5031349adb5b467c31018 setup.py --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ name='py', description='library with cross-python path, ini-parsing, io, code, log facilities', long_description = open('README.txt').read(), - version='1.4.22', + version='1.4.23', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], https://bitbucket.org/hpk42/py/commits/591f6bfa83c0/ Changeset: 591f6bfa83c0 User: hpk42 Date: 2014-08-04 13:31:29 Summary: Added tag 1.4.23 for changeset 01ae2cfcc61c Affected #: 1 file diff -r 01ae2cfcc61c4fcb3aa5031349adb5b467c31018 -r 591f6bfa83c0f26d503a57f60c3275d33a4208f0 .hgtags --- a/.hgtags +++ b/.hgtags @@ -55,3 +55,4 @@ 284cc172e294d48edc840012e1451c32c3963d92 1.4.19 a3e0626aa0c5aecf271367dc77e476ab216ea3c8 1.4.20 5e48016c4a3af8e7358a1267d33d021e71765bed 1.4.21 +01ae2cfcc61c4fcb3aa5031349adb5b467c31018 1.4.23 Repository URL: https://bitbucket.org/hpk42/py/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit