Hello community,

here is the log from the commit of package python3-py for openSUSE:Factory 
checked in at 2015-07-14 17:43:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-py (Old)
 and      /work/SRC/openSUSE:Factory/.python3-py.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-py"

Changes:
--------
New Changes file:

--- /dev/null   2015-06-25 09:04:34.320025005 +0200
+++ /work/SRC/openSUSE:Factory/.python3-py.new/python3-py-doc.changes   
2015-07-14 17:44:31.000000000 +0200
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Wed Jul  8 13:13:43 UTC 2015 - [email protected]
+
+- Split documentation into separate package to avoid build loop
+
--- /work/SRC/openSUSE:Factory/python3-py/python3-py.changes    2015-06-01 
09:51:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python3-py.new/python3-py.changes       
2015-07-14 17:44:31.000000000 +0200
@@ -1,0 +2,19 @@
+Wed Jul  8 13:13:43 UTC 2015 - [email protected]
+
+- Split documentation into separate package to avoid build loop
+
+-------------------------------------------------------------------
+Tue Jun 30 23:00:17 UTC 2015 - [email protected]
+
+- update to version 1.4.30:
+  * fix issue68 an assert with a multiline list comprehension was not
+    reported correctly. Thanks Henrik Heibuerger.
+
+- changes from version 1.4.29:
+  * fix issue55: revert a change to the statement finding algorithm
+    which is used by pytest for generating tracebacks. Thanks Daniel
+    Hahler for initial analysis.
+  * fix pytest issue254 for when traceback rendering can’t find valid
+    source code. Thanks Ionel Cristian Maries.
+
+-------------------------------------------------------------------

Old:
----
  py-1.4.28.tar.gz

New:
----
  py-1.4.30.tar.gz
  python3-py-doc.changes
  python3-py-doc.spec

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-py-doc.spec ++++++
#
# spec file for package python3-py-doc
#
# 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
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           python3-py-doc
Version:        1.4.30
Release:        0
Summary:        Library with cross-python path, ini-parsing, io, code, log 
facilities
License:        MIT
Group:          Development/Languages/Python
Url:            http://pylib.readthedocs.org/
Source:         http://pypi.python.org/packages/source/p/py/py-%{version}.tar.gz
BuildRequires:  python3-Sphinx
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%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
* py.path:  uniform local and svn path objects

This package provides the documentation for python3-py

%prep
%setup -q -n py-%{version}

%build
cd doc && make html && rm -r _build/html/.buildinfo

%install
# Only build documentation

%files
%defattr(-,root,root,-)
%doc LICENSE 
%doc doc/_build/html

%changelog
++++++ python3-py.spec ++++++
--- /var/tmp/diff_new_pack.fm3Xr8/_old  2015-07-14 17:44:32.000000000 +0200
+++ /var/tmp/diff_new_pack.fm3Xr8/_new  2015-07-14 17:44:32.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python3-py
-Version:        1.4.28
+Version:        1.4.30
 Release:        0
 Summary:        Library with cross-python path, ini-parsing, io, code, log 
facilities
 License:        MIT
@@ -25,7 +25,6 @@
 Url:            http://pylib.readthedocs.org/
 Source:         
http://pypi.python.org/packages/source/p/py/py-%{version}.tar.gz
 BuildRequires:  python3
-BuildRequires:  python3-Sphinx
 BuildRequires:  python3-devel
 BuildRequires:  python3-setuptools
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -46,14 +45,13 @@
 
 %build
 python3 setup.py build
-cd doc && make html && rm -r _build/html/.buildinfo # Generate HTML 
documentation
 
 %install
 python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE README.txt doc/_build/html
+%doc LICENSE README.txt
 %{python3_sitelib}/*
 
 %changelog

++++++ py-1.4.28.tar.gz -> py-1.4.30.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/CHANGELOG new/py-1.4.30/CHANGELOG
--- old/py-1.4.28/CHANGELOG     2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/CHANGELOG     2015-06-26 12:31:25.000000000 +0200
@@ -1,3 +1,21 @@
+1.4.30
+==================================================
+
+- fix issue68 an assert with a  multiline list comprehension 
+  was not reported correctly. Thanks Henrik Heibuerger.
+
+
+1.4.29
+==================================================
+
+- fix issue55: revert a change to the statement finding algorithm
+  which is used by pytest for generating tracebacks.
+  Thanks Daniel Hahler for initial analysis.
+
+- fix pytest issue254 for when traceback rendering can't
+  find valid source code.  Thanks Ionel Cristian Maries.
+
+
 1.4.28
 ==================================================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/PKG-INFO new/py-1.4.30/PKG-INFO
--- old/py-1.4.28/PKG-INFO      2015-05-22 08:30:56.000000000 +0200
+++ new/py-1.4.30/PKG-INFO      2015-06-26 12:31:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: py
-Version: 1.4.28
+Version: 1.4.30
 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/conftest.py new/py-1.4.30/conftest.py
--- old/py-1.4.28/conftest.py   2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/conftest.py   2015-06-26 12:31:25.000000000 +0200
@@ -14,26 +14,6 @@
     group.addoption('--runslowtests',
            action="store_true", dest="runslowtests", default=False,
            help=("run slow tests"))
-    group.addoption('--lsof',
-           action="store_true", dest="lsof", default=False,
-           help=("run FD checks if lsof is available"))
-
-def pytest_configure(config):
-    if config.getvalue("lsof"):
-        try:
-            out = py.process.cmdexec("lsof -p %d" % pid)
-        except py.process.cmdexec.Error:
-            pass
-        else:
-            config._numfiles = len([x for x in out.split("\n") if "REG" in x])
-
-def pytest_unconfigure(config, __multicall__):
-    if not hasattr(config, '_numfiles'):
-        return
-    __multicall__.execute()
-    out2 = py.process.cmdexec("lsof -p %d" % pid)
-    len2 = len([x for x in out2.split("\n") if "REG" in x])
-    assert len2 < config._numfiles + 7, out2
 
 def pytest_funcarg__sshhost(request):
     val = request.config.getvalue("sshhost")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/doc/index.txt new/py-1.4.30/doc/index.txt
--- old/py-1.4.28/doc/index.txt 2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/doc/index.txt 2015-06-26 12:31:25.000000000 +0200
@@ -33,6 +33,7 @@
 
     announce/release-2.0.0
     changelog
+    announce/*
 
 Indices and tables
 ==================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/py/__init__.py new/py-1.4.30/py/__init__.py
--- old/py-1.4.28/py/__init__.py        2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/py/__init__.py        2015-06-26 12:31:25.000000000 +0200
@@ -8,7 +8,7 @@
 
 (c) Holger Krekel and others, 2004-2014
 """
-__version__ = '1.4.28'
+__version__ = '1.4.30'
 
 from py import _apipkg
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/py/_code/code.py 
new/py-1.4.30/py/_code/code.py
--- old/py-1.4.28/py/_code/code.py      2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/py/_code/code.py      2015-06-26 12:31:25.000000000 +0200
@@ -470,7 +470,7 @@
     def get_source(self, source, line_index=-1, excinfo=None, short=False):
         """ return formatted and marked up source lines. """
         lines = []
-        if source is None:
+        if source is None or line_index >= len(source.lines):
             source = py.code.Source("???")
             line_index = 0
         if line_index < 0:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/py/_code/source.py 
new/py-1.4.30/py/_code/source.py
--- old/py-1.4.28/py/_code/source.py    2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/py/_code/source.py    2015-06-26 12:31:25.000000000 +0200
@@ -1,4 +1,6 @@
 from __future__ import generators
+
+from bisect import bisect_right
 import sys
 import inspect, tokenize
 import py
@@ -291,14 +293,10 @@
         while True:
             yield ''
 
-    r = readline_generator(lines)
-    try:
-        readline = r.next
-    except AttributeError:
-        readline = r.__next__
+    it = readline_generator(lines)
 
     try:
-        for _, _, (sline, _), (eline, _), _ in 
tokenize.generate_tokens(readline):
+        for _, _, (sline, _), (eline, _), _ in 
tokenize.generate_tokens(lambda: next(it)):
             if sline > len(lines):
                 break # End of input reached
             if sline > len(newlines):
@@ -317,46 +315,29 @@
     newlines.extend(lines[len(newlines):])
     return newlines
 
-def get_statement_startend(lineno, nodelist):
-    from bisect import bisect_right
-    # lineno starts at 0
-    nextlineno = None
-    while 1:
-        lineno_list = [x.lineno-1 for x in nodelist] # ast indexes start at 1
-        insert_index = bisect_right(lineno_list, lineno)
-        if insert_index >= len(nodelist):
-            insert_index -= 1
-        elif lineno < (nodelist[insert_index].lineno - 1) and insert_index > 0:
-            insert_index -= 1
-            assert lineno >= (nodelist[insert_index].lineno - 1)
-        nextnode = nodelist[insert_index]
-
-        try:
-            nextlineno = nodelist[insert_index+1].lineno - 1
-        except IndexError:
-            pass
-        lastnodelist = nodelist
-        nodelist = getnodelist(nextnode)
-        if not nodelist:
-            start, end = nextnode.lineno-1, nextlineno
-            start = min(lineno, start)
-            assert start <= lineno  and (end is None or lineno < end)
-            #print "returning", start, end
-            return start, end
 
-def getnodelist(node):
-    import _ast
+def get_statement_startend2(lineno, node):
+    import ast
+    # flatten all statements and except handlers into one lineno-list
+    # AST's line numbers start indexing at 1
     l = []
-    #print "node", node, "fields", node._fields, "lineno", getattr(node, 
"lineno", 0) - 1
-    for subname in "test", "type", "body", "handlers", "orelse", "finalbody":
-        attr = getattr(node, subname, None)
-        if attr is not None:
-            if isinstance(attr, list):
-                l.extend(attr)
-            elif hasattr(attr, "lineno"):
-                l.append(attr)
-    #print "returning nodelist", l
-    return l
+    for x in ast.walk(node):
+        if isinstance(x, _ast.stmt) or isinstance(x, _ast.ExceptHandler):
+            l.append(x.lineno - 1)
+            for name in "finalbody", "orelse":
+                val = getattr(x, name, None)
+                if val:
+                    # treat the finally/orelse part as its own statement
+                    l.append(val[0].lineno - 1 - 1)
+    l.sort()
+    insert_index = bisect_right(l, lineno)
+    start = l[insert_index - 1]
+    if insert_index >= len(l):
+        end = None
+    else:
+        end = l[insert_index]
+    return start, end
+
 
 def getstatementrange_ast(lineno, source, assertion=False, astnode=None):
     if astnode is None:
@@ -368,26 +349,39 @@
         except ValueError:
             start, end = getstatementrange_old(lineno, source, assertion)
             return None, start, end
-    start, end = get_statement_startend(lineno, getnodelist(astnode))
+    start, end = get_statement_startend2(lineno, astnode)
     # we need to correct the end:
     # - ast-parsing strips comments
-    # - else statements do not have a separate lineno
     # - there might be empty lines
+    # - we might have lesser indented code blocks at the end
     if end is None:
         end = len(source.lines)
-    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:
+
+    if end > start + 1:
+        # make sure we don't span differently indented code blocks
+        # by using the BlockFinder helper used which inspect.getsource() uses 
itself
+        block_finder = inspect.BlockFinder()
+        # if we start with an indented line, put blockfinder to "started" mode
+        block_finder.started = source.lines[start][0].isspace()
+        it = ((x + "\n") for x in source.lines[start:end])
+        try:
+            for tok in tokenize.generate_tokens(lambda: next(it)):
+                block_finder.tokeneater(*tok)
+        except (inspect.EndOfBlock, IndentationError):
+            end = block_finder.last + start
+        except Exception:
+            pass
+
+    # the end might still point to a comment or empty line, correct it
+    while end:
+        line = source.lines[end - 1].lstrip()
+        if line.startswith("#") or not line:
+            end -= 1
+        else:
             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):
     """ return (start, end) tuple which spans the minimal
         statement region which containing the given lineno.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/py.egg-info/PKG-INFO 
new/py-1.4.30/py.egg-info/PKG-INFO
--- old/py-1.4.28/py.egg-info/PKG-INFO  2015-05-22 08:30:56.000000000 +0200
+++ new/py-1.4.30/py.egg-info/PKG-INFO  2015-06-26 12:31:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: py
-Version: 1.4.28
+Version: 1.4.30
 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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/setup.py new/py-1.4.30/setup.py
--- old/py-1.4.28/setup.py      2015-05-22 08:30:55.000000000 +0200
+++ new/py-1.4.30/setup.py      2015-06-26 12:31:25.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.28',
+        version='1.4.30',
         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.28/testing/code/test_excinfo.py 
new/py-1.4.30/testing/code/test_excinfo.py
--- old/py-1.4.28/testing/code/test_excinfo.py  2015-05-22 08:30:55.000000000 
+0200
+++ new/py-1.4.30/testing/code/test_excinfo.py  2015-06-26 12:31:25.000000000 
+0200
@@ -762,6 +762,56 @@
         assert tw.lines[9] == ""
         assert tw.lines[10].endswith("mod.py:3: ValueError")
 
+    def test_toterminal_long_missing_source(self, importasmod, tmpdir):
+        mod = importasmod("""
+            def g(x):
+                raise ValueError(x)
+            def f():
+                g(3)
+        """)
+        excinfo = py.test.raises(ValueError, mod.f)
+        tmpdir.join('mod.py').remove()
+        excinfo.traceback = excinfo.traceback.filter()
+        repr = excinfo.getrepr()
+        tw = TWMock()
+        repr.toterminal(tw)
+        assert tw.lines[0] == ""
+        tw.lines.pop(0)
+        assert tw.lines[0] == ">   ???"
+        assert tw.lines[1] == ""
+        assert tw.lines[2].endswith("mod.py:5: ")
+        assert tw.lines[3] == ("_ ", None)
+        assert tw.lines[4] == ""
+        assert tw.lines[5] == ">   ???"
+        assert tw.lines[6] == "E   ValueError: 3"
+        assert tw.lines[7] == ""
+        assert tw.lines[8].endswith("mod.py:3: ValueError")
+
+    def test_toterminal_long_incomplete_source(self, importasmod, tmpdir):
+        mod = importasmod("""
+            def g(x):
+                raise ValueError(x)
+            def f():
+                g(3)
+        """)
+        excinfo = py.test.raises(ValueError, mod.f)
+        tmpdir.join('mod.py').write('asdf')
+        excinfo.traceback = excinfo.traceback.filter()
+        repr = excinfo.getrepr()
+        tw = TWMock()
+        repr.toterminal(tw)
+        assert tw.lines[0] == ""
+        tw.lines.pop(0)
+        assert tw.lines[0] == ">   ???"
+        assert tw.lines[1] == ""
+        assert tw.lines[2].endswith("mod.py:5: ")
+        assert tw.lines[3] == ("_ ", None)
+        assert tw.lines[4] == ""
+        assert tw.lines[5] == ">   ???"
+        assert tw.lines[6] == "E   ValueError: 3"
+        assert tw.lines[7] == ""
+        assert tw.lines[8].endswith("mod.py:3: ValueError")
+
     def test_toterminal_long_filenames(self, importasmod):
         mod = importasmod("""
             def f():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/testing/code/test_source.py 
new/py-1.4.30/testing/code/test_source.py
--- old/py-1.4.28/testing/code/test_source.py   2015-05-22 08:30:55.000000000 
+0200
+++ new/py-1.4.30/testing/code/test_source.py   2015-06-26 12:31:25.000000000 
+0200
@@ -224,7 +224,6 @@
         assert len(source) == 6
         assert source.getstatementrange(2) == (1, 4)
 
-    @py.test.mark.xfail
     def test_getstatementrange_bug2(self):
         source = Source("""\
             assert (
@@ -240,6 +239,18 @@
         assert len(source) == 9
         assert source.getstatementrange(5) == (0, 9)
 
+    def test_getstatementrange_ast_issue58(self):
+        source = Source("""\
+
+            def test_some():
+                for a in [a for a in
+                    CAUSE_ERROR]: pass
+
+            x = 3
+        """)
+        assert getstatement(2, source).lines == source.lines[2:3]
+        assert getstatement(3, source).lines == source.lines[3:4]
+
     @py.test.mark.skipif("sys.version_info < (2,6)")
     def test_getstatementrange_out_of_bounds_py3(self):
         source = Source("if xxx:\n   from .collections import something")
@@ -508,6 +519,15 @@
         assert str(getstatement(line, source)) == '    assert False'
     assert str(getstatement(10, source)) == '"""'
 
+def test_comment_in_statement():
+    source = '''test(foo=1,
+    # comment 1
+    bar=2)
+'''
+    for line in range(1,3):
+        assert str(getstatement(line, source)) == \
+               'test(foo=1,\n    # comment 1\n    bar=2)'
+
 def test_single_line_else():
     source = getstatement(1, "if False: 2\nelse: 3")
     assert str(source) == "else: 3"
@@ -516,6 +536,13 @@
     source = getstatement(1, "try: 1\nfinally: 3")
     assert str(source) == "finally: 3"
 
+def test_issue55():
+    source = ('def round_trip(dinp):\n  assert 1 == dinp\n'
+              'def test_rt():\n  round_trip("""\n""")\n')
+    s = getstatement(3, source)
+    assert str(s) == '  round_trip("""\n""")'
+
+
 def XXXtest_multiline():
     source = getstatement(0, """\
 raise ValueError(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/py-1.4.28/testing/path/test_local.py 
new/py-1.4.30/testing/path/test_local.py
--- old/py-1.4.28/testing/path/test_local.py    2015-05-22 08:30:55.000000000 
+0200
+++ new/py-1.4.30/testing/path/test_local.py    2015-06-26 12:31:25.000000000 
+0200
@@ -115,7 +115,8 @@
             assert p.check()
 
     @pytest.mark.xfail("sys.version_info < (2,6) and sys.platform == 'win32'")
-    def test_tilde_expansion(self):
+    def test_tilde_expansion(self, monkeypatch, tmpdir):
+        monkeypatch.setenv("HOME", str(tmpdir))
         p = py.path.local("~", expanduser=True)
         assert p == os.path.expanduser("~")
 


Reply via email to