Hello community, here is the log from the commit of package python3-py for openSUSE:Factory checked in at 2015-05-11 19:39:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-py (Old) and /work/SRC/openSUSE:Factory/.python3-py.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-py" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-py/python3-py.changes 2015-01-05 04:43:20.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-py.new/python3-py.changes 2015-05-11 19:49:11.000000000 +0200 @@ -1,0 +2,10 @@ +Sat May 9 21:50:06 UTC 2015 - a...@gmx.de + +- update to version 1.4.27: + * avoid calling normpath twice in py.path.local + * py.builtin._reraise properly reraises under Python3 now. + * fix issue53 - remove module index, thanks jenisys. + * allow posix path separators when "fnmatch" is called. Thanks + Christian Long for the complete PR. + +------------------------------------------------------------------- Old: ---- py-1.4.26.tar.gz New: ---- py-1.4.27.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-py.spec ++++++ --- /var/tmp/diff_new_pack.PhxzEs/_old 2015-05-11 19:49:12.000000000 +0200 +++ /var/tmp/diff_new_pack.PhxzEs/_new 2015-05-11 19:49:12.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python3-py # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python3-py -Version: 1.4.26 +Version: 1.4.27 Release: 0 Summary: Library with cross-python path, ini-parsing, io, code, log facilities License: MIT ++++++ py-1.4.26.tar.gz -> py-1.4.27.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/CHANGELOG new/py-1.4.27/CHANGELOG --- old/py-1.4.26/CHANGELOG 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/CHANGELOG 2015-05-07 11:36:24.000000000 +0200 @@ -1,3 +1,16 @@ +1.4.27 +================================================== + +- fix issue59: point to new repo site + +- allow a new ensuresyspath="append" mode for py.path.local.pyimport() + so that a neccessary import path is appended instead of prepended to + sys.path + +- strike undocumented, untested argument to py.path.local.pypkgpath + +- speed up py.path.local.dirpath by a factor of 10 + 1.4.26 ================================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/PKG-INFO new/py-1.4.27/PKG-INFO --- old/py-1.4.26/PKG-INFO 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/PKG-INFO 2015-05-07 11:36:24.000000000 +0200 @@ -1,28 +1,32 @@ Metadata-Version: 1.1 Name: py -Version: 1.4.26 +Version: 1.4.27 Summary: library with cross-python path, ini-parsing, io, code, log facilities Home-page: http://pylib.readthedocs.org/ Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others Author-email: pytest-...@python.org License: MIT license -Description: The py lib is a Python development support library featuring - the following tools and modules: - - * py.path: uniform local and svn path objects - * py.apipkg: explicit API control and lazy-importing - * py.iniconfig: easy parsing of .ini files - * py.code: dynamic code generation and introspection - - NOTE: prior to the 1.4 release this distribution used to - contain py.test which is now its own package, see http://pytest.org - - For questions and more information please visit http://pylib.readthedocs.org - - Bugs and issues: http://bitbucket.org/hpk42/py/issues/ - - Authors: Holger Krekel and others, 2004-2014 - +Description: .. image:: https://drone.io/bitbucket.org/pytest-dev/py/status.png + :target: https://drone.io/bitbucket.org/pytest-dev/py/latest + .. image:: https://pypip.in/v/py/badge.png + :target: https://pypi.python.org/pypi/py + + The py lib is a Python development support library featuring + the following tools and modules: + + * py.path: uniform local and svn path objects + * py.apipkg: explicit API control and lazy-importing + * py.iniconfig: easy parsing of .ini files + * py.code: dynamic code generation and introspection + + NOTE: prior to the 1.4 release this distribution used to + contain py.test which is now its own package, see http://pytest.org + + For questions and more information please visit http://pylib.readthedocs.org + + Bugs and issues: http://bitbucket.org/pytest-dev/py/issues/ + + Authors: Holger Krekel and others, 2004-2015 Platform: unix Platform: linux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/README.txt new/py-1.4.27/README.txt --- old/py-1.4.26/README.txt 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/README.txt 2015-05-07 11:36:24.000000000 +0200 @@ -1,17 +1,21 @@ -The py lib is a Python development support library featuring -the following tools and modules: - -* py.path: uniform local and svn path objects -* py.apipkg: explicit API control and lazy-importing -* py.iniconfig: easy parsing of .ini files -* py.code: dynamic code generation and introspection - -NOTE: prior to the 1.4 release this distribution used to -contain py.test which is now its own package, see http://pytest.org - -For questions and more information please visit http://pylib.readthedocs.org - -Bugs and issues: http://bitbucket.org/hpk42/py/issues/ - -Authors: Holger Krekel and others, 2004-2014 - +.. image:: https://drone.io/bitbucket.org/pytest-dev/py/status.png + :target: https://drone.io/bitbucket.org/pytest-dev/py/latest +.. image:: https://pypip.in/v/py/badge.png + :target: https://pypi.python.org/pypi/py + +The py lib is a Python development support library featuring +the following tools and modules: + +* py.path: uniform local and svn path objects +* py.apipkg: explicit API control and lazy-importing +* py.iniconfig: easy parsing of .ini files +* py.code: dynamic code generation and introspection + +NOTE: prior to the 1.4 release this distribution used to +contain py.test which is now its own package, see http://pytest.org + +For questions and more information please visit http://pylib.readthedocs.org + +Bugs and issues: http://bitbucket.org/pytest-dev/py/issues/ + +Authors: Holger Krekel and others, 2004-2015 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/__init__.py new/py-1.4.27/py/__init__.py --- old/py-1.4.26/py/__init__.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/__init__.py 2015-05-07 11:36:24.000000000 +0200 @@ -8,7 +8,7 @@ (c) Holger Krekel and others, 2004-2014 """ -__version__ = '1.4.26' +__version__ = '1.4.27' from py import _apipkg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/_builtin.py new/py-1.4.27/py/_builtin.py --- old/py-1.4.26/py/_builtin.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/_builtin.py 2015-05-07 11:36:24.000000000 +0200 @@ -220,7 +220,7 @@ locals = globals exec2(obj, globals, locals) -if sys.version_info >= (3,0): +if sys.version_info >= (3, 0): def _reraise(cls, val, tb): __tracebackhide__ = True assert hasattr(val, '__traceback__') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/_code/source.py new/py-1.4.27/py/_code/source.py --- old/py-1.4.26/py/_code/source.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/_code/source.py 2015-05-07 11:36:24.000000000 +0200 @@ -375,15 +375,17 @@ # - there might be empty lines if end is None: end = len(source.lines) - while end: - line = source.lines[end-1].lstrip() - if (not line - or line.startswith("#") - or line.replace(" ", "") == "else:" - or line.replace(" ", "") == "finally:"): - end -= 1 - else: + import re + prefix = re.match(r"\s*", source.lines[start]).group() + i = start+1 + while i < end: + line = source.lines[i] + if not line or len(line)<len(prefix) or line[:len(prefix)]!=prefix: break + rem = line[len(prefix):].lstrip() + if not rem or rem[0]=='#': break + i += 1 + end = i return astnode, start, end def getstatementrange_old(lineno, source, assertion=False): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/_io/terminalwriter.py new/py-1.4.27/py/_io/terminalwriter.py --- old/py-1.4.26/py/_io/terminalwriter.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/_io/terminalwriter.py 2015-05-07 11:36:24.000000000 +0200 @@ -31,17 +31,24 @@ def get_terminal_width(): + height = width = 0 try: height, width = _getdimensions() except py.builtin._sysex: raise except: - # FALLBACK + # pass to fallback below + pass + + if width == 0: + # FALLBACK: + # * some exception happened + # * or this is emacs terminal which reports (0,0) width = int(os.environ.get('COLUMNS', 80)) - else: - # XXX the windows getdimensions may be bogus, let's sanify a bit - if width < 40: - width = 80 + + # XXX the windows getdimensions may be bogus, let's sanify a bit + if width < 40: + width = 80 return width terminal_width = get_terminal_width() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/_path/common.py new/py-1.4.27/py/_path/common.py --- old/py-1.4.26/py/_path/common.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/_path/common.py 2015-05-07 11:36:24.000000000 +0200 @@ -113,9 +113,7 @@ ext = property(ext, None, None, ext.__doc__) def dirpath(self, *args, **kwargs): - """ return the directory Path of the current Path joined - with any given path arguments. - """ + """ return the directory path joined with any given path arguments. """ return self.new(basename='').join(*args, **kwargs) def read_binary(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py/_path/local.py new/py-1.4.27/py/_path/local.py --- old/py-1.4.26/py/_path/local.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py/_path/local.py 2015-05-07 11:36:24.000000000 +0200 @@ -10,7 +10,7 @@ from py._path.common import iswin32 from stat import S_ISLNK, S_ISDIR, S_ISREG -from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink +from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname if sys.version_info > (3,0): def map_as_list(func, iter): @@ -304,6 +304,14 @@ raise ValueError("invalid part specification %r" % name) return res + def dirpath(self, *args): + """ return the directory path joined with any given path arguments. """ + path = object.__new__(self.__class__) + path.strpath = dirname(self.strpath) + if args: + path = path.join(*args) + return path + def join(self, *args, **kwargs): """ return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any @@ -570,35 +578,6 @@ """ return string representation of the Path. """ return self.strpath - def pypkgpath(self, pkgname=None): - """ return the Python package path by looking for a - pkgname. If pkgname is None look for the last - directory upwards which still contains an __init__.py - and whose basename is python-importable. - Return None if a pkgpath can not be determined. - """ - pkgpath = None - for parent in self.parts(reverse=True): - if pkgname is None: - if parent.check(file=1): - continue - if not isimportable(parent.basename): - break - if parent.join('__init__.py').check(): - pkgpath = parent - continue - return pkgpath - else: - if parent.basename == pkgname: - return parent - return pkgpath - - def _prependsyspath(self, path): - s = str(path) - if s != sys.path[0]: - #print "prepending to sys.path", s - sys.path.insert(0, s) - def chmod(self, mode, rec=0): """ change permissions to the given mode. If mode is an integer it directly encodes the os-specific modes. @@ -611,33 +590,61 @@ py.error.checked_call(os.chmod, str(x), mode) py.error.checked_call(os.chmod, str(self), mode) + def pypkgpath(self): + """ return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + Return None if a pkgpath can not be determined. + """ + pkgpath = None + for parent in self.parts(reverse=True): + if parent.isdir(): + if not parent.join('__init__.py').exists(): + break + if not isimportable(parent.basename): + break + pkgpath = parent + return pkgpath + + def _ensuresyspath(self, ensuremode, path): + if ensuremode: + s = str(path) + if ensuremode == "append": + if s not in sys.path: + sys.path.append(s) + else: + if s != sys.path[0]: + sys.path.insert(0, s) + def pyimport(self, modname=None, ensuresyspath=True): """ return path as an imported python module. - if modname is None, look for the containing package - and construct an according module name. - The module will be put/looked up in sys.modules. + + If modname is None, look for the containing package + and construct an according module name. + The module will be put/looked up in sys.modules. + if ensuresyspath is True then the root dir for importing + the file (taking __init__.py files into account) will + be prepended to sys.path if it isn't there already. + If ensuresyspath=="append" the root dir will be appended + if it isn't already contained in sys.path. + if ensuresyspath is False no modification of syspath happens. """ if not self.check(): raise py.error.ENOENT(self) - #print "trying to import", self + pkgpath = None if modname is None: pkgpath = self.pypkgpath() if pkgpath is not None: - if ensuresyspath: - self._prependsyspath(pkgpath.dirpath()) - __import__(pkgpath.basename) - pkg = sys.modules[pkgpath.basename] - names = self.new(ext='').relto(pkgpath.dirpath()) - names = names.split(self.sep) - if names and names[-1] == "__init__": + pkgroot = pkgpath.dirpath() + names = self.new(ext="").relto(pkgroot).split(self.sep) + if names[-1] == "__init__": names.pop() modname = ".".join(names) else: - # no package scope, still make it possible - if ensuresyspath: - self._prependsyspath(self.dirpath()) + pkgroot = self.dirpath() modname = self.purebasename + + self._ensuresyspath(ensuresyspath, pkgroot) __import__(modname) mod = sys.modules[modname] if self.basename == "__init__.py": @@ -651,7 +658,6 @@ if modfile.endswith(os.path.sep + "__init__.py"): if self.basename != "__init__.py": modfile = modfile[:-12] - try: issame = self.samefile(modfile) except py.error.ENOENT: @@ -898,8 +904,6 @@ fsrc.close() def isimportable(name): - if name: - if not (name[0].isalpha() or name[0] == '_'): - return False - name= name.replace("_", '') + if name and (name[0].isalpha() or name[0] == '_'): + name = name.replace("_", '') return not name or name.isalnum() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/py.egg-info/PKG-INFO new/py-1.4.27/py.egg-info/PKG-INFO --- old/py-1.4.26/py.egg-info/PKG-INFO 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/py.egg-info/PKG-INFO 2015-05-07 11:36:24.000000000 +0200 @@ -1,28 +1,32 @@ Metadata-Version: 1.1 Name: py -Version: 1.4.26 +Version: 1.4.27 Summary: library with cross-python path, ini-parsing, io, code, log facilities Home-page: http://pylib.readthedocs.org/ Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others Author-email: pytest-...@python.org License: MIT license -Description: The py lib is a Python development support library featuring - the following tools and modules: - - * py.path: uniform local and svn path objects - * py.apipkg: explicit API control and lazy-importing - * py.iniconfig: easy parsing of .ini files - * py.code: dynamic code generation and introspection - - NOTE: prior to the 1.4 release this distribution used to - contain py.test which is now its own package, see http://pytest.org - - For questions and more information please visit http://pylib.readthedocs.org - - Bugs and issues: http://bitbucket.org/hpk42/py/issues/ - - Authors: Holger Krekel and others, 2004-2014 - +Description: .. image:: https://drone.io/bitbucket.org/pytest-dev/py/status.png + :target: https://drone.io/bitbucket.org/pytest-dev/py/latest + .. image:: https://pypip.in/v/py/badge.png + :target: https://pypi.python.org/pypi/py + + The py lib is a Python development support library featuring + the following tools and modules: + + * py.path: uniform local and svn path objects + * py.apipkg: explicit API control and lazy-importing + * py.iniconfig: easy parsing of .ini files + * py.code: dynamic code generation and introspection + + NOTE: prior to the 1.4 release this distribution used to + contain py.test which is now its own package, see http://pytest.org + + For questions and more information please visit http://pylib.readthedocs.org + + Bugs and issues: http://bitbucket.org/pytest-dev/py/issues/ + + Authors: Holger Krekel and others, 2004-2015 Platform: unix Platform: linux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/setup.py new/py-1.4.27/setup.py --- old/py-1.4.26/setup.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/setup.py 2015-05-07 11:36:24.000000000 +0200 @@ -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.26', + version='1.4.27', url='http://pylib.readthedocs.org/', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/testing/code/test_source.py new/py-1.4.27/testing/code/test_source.py --- old/py-1.4.26/testing/code/test_source.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/testing/code/test_source.py 2015-05-07 11:36:24.000000000 +0200 @@ -489,6 +489,25 @@ source = getstatement(0, "raise ValueError\n#hello") assert str(source) == "raise ValueError" +def test_comments(): + source = '''def test(): + "comment 1" + x = 1 + # comment 2 + # comment 3 + + assert False + +""" +comment 4 +""" +''' + for line in range(2,6): + assert str(getstatement(line, source)) == ' x = 1' + for line in range(6,10): + assert str(getstatement(line, source)) == ' assert False' + assert str(getstatement(10, source)) == '"""' + def test_single_line_else(): source = getstatement(1, "if False: 2\nelse: 3") assert str(source) == "else: 3" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/testing/io_/test_terminalwriter.py new/py-1.4.27/testing/io_/test_terminalwriter.py --- old/py-1.4.26/testing/io_/test_terminalwriter.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/testing/io_/test_terminalwriter.py 2015-05-07 11:36:24.000000000 +0200 @@ -42,6 +42,13 @@ tw = py.io.TerminalWriter() assert tw.fullwidth == 80 +def test_terminalwriter_getdimensions_emacs(monkeypatch): + # emacs terminal returns (0,0) but set COLUMNS properly + monkeypatch.setattr(terminalwriter, '_getdimensions', lambda: (0,0)) + monkeypatch.setenv('COLUMNS', '42') + tw = py.io.TerminalWriter() + assert tw.fullwidth == 42 + def test_terminalwriter_computes_width(monkeypatch): monkeypatch.setattr(terminalwriter, 'get_terminal_width', lambda: 42) tw = py.io.TerminalWriter() @@ -262,4 +269,3 @@ tw.line("hello", bold=True) s = f.getvalue() assert s == "hello\n" - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/py-1.4.26/testing/path/test_local.py new/py-1.4.27/testing/path/test_local.py --- old/py-1.4.26/testing/path/test_local.py 2014-10-24 13:56:34.000000000 +0200 +++ new/py-1.4.27/testing/path/test_local.py 2015-05-07 11:36:24.000000000 +0200 @@ -479,6 +479,15 @@ m2 = p2.pyimport() assert m1 == m2 + def test_ensuresyspath_append(self, tmpdir): + root1 = tmpdir.mkdir("root1") + file1 = root1.ensure("x123.py") + assert str(root1) not in sys.path + file1.pyimport(ensuresyspath="append") + assert str(root1) == sys.path[-1] + assert str(root1) not in sys.path[:-1] + + def test_pypkgdir(tmpdir): pkg = tmpdir.ensure('pkg1', dir=1) pkg.ensure("__init__.py") @@ -789,15 +798,19 @@ class TestUnicodePy2Py3: - def test_join_ensure(self, tmpdir): + def test_join_ensure(self, tmpdir, monkeypatch): + if sys.version_info >= (3,0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") x = py.path.local(tmpdir.strpath) - part = py.builtin._totext("hällo", "utf8") + part = "hällo" y = x.ensure(part) assert x.join(part) == y def test_listdir(self, tmpdir): + if sys.version_info >= (3,0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") x = py.path.local(tmpdir.strpath) - part = py.builtin._totext("hällo", "utf8") + part = "hällo" y = x.ensure(part) assert x.listdir(part)[0] == y