Hello community,

here is the log from the commit of package python-pycodestyle for 
openSUSE:Factory checked in at 2018-10-11 11:38:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pycodestyle (Old)
 and      /work/SRC/openSUSE:Factory/.python-pycodestyle.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pycodestyle"

Thu Oct 11 11:38:44 2018 rev:5 rq:639620 version:2.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pycodestyle/python-pycodestyle.changes    
2018-08-10 09:44:24.485752119 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-pycodestyle.new/python-pycodestyle.changes   
    2018-10-11 11:38:47.755295201 +0200
@@ -1,0 +2,6 @@
+Tue Oct  2 14:59:36 UTC 2018 - MatÄ›j Cepl <[email protected]>
+
+- Add comp_w_changes_tokenize.patch to make tests more stable
+  (gh#pycqa/pycodestyle#786)
+
+-------------------------------------------------------------------

New:
----
  comp_w_changes_tokenize.patch

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

Other differences:
------------------
++++++ python-pycodestyle.spec ++++++
--- /var/tmp/diff_new_pack.DYKqcD/_old  2018-10-11 11:38:48.295294513 +0200
+++ /var/tmp/diff_new_pack.DYKqcD/_new  2018-10-11 11:38:48.299294509 +0200
@@ -12,7 +12,7 @@
 # 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/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -26,6 +26,7 @@
 Group:          Development/Languages/Python
 Url:            https://pycodestyle.readthedocs.io/
 Source:         
https://files.pythonhosted.org/packages/source/p/pycodestyle/pycodestyle-%{version}.tar.gz
+Patch0:         comp_w_changes_tokenize.patch
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
@@ -46,6 +47,7 @@
 
 %prep
 %setup -q -n pycodestyle-%{version}
+%autopatch -p1
 sed -ri '1s/^#!.*//' pycodestyle.py
 
 %build

++++++ comp_w_changes_tokenize.patch ++++++
>From 397463014fda3cdefe8d6c9d117ae16d878dc494 Mon Sep 17 00:00:00 2001
From: Michael Hudson-Doyle <[email protected]>
Date: Tue, 25 Sep 2018 14:58:57 +1200
Subject: [PATCH] Keep compability with stdlib tokenize.py changes

https://github.com/python/cpython/commit/c4ef4896eac86a6759901c8546e26de4695a1389
is not yet part of any release of Python but has been backported to all
versions in Git (includeing 2.7!). It causes the tokenize.py module to
emit a synthetic NEWLINE token for files that do not in fact end with a
newline, which confuses pycodestyle's checks for blank lines at the end
of a file. Fortunately the synthetic NEWLINE tokens are easy to detect
(the token text is "").

Fixes #786
---
 pycodestyle.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pycodestyle.py b/pycodestyle.py
index 0d725d27..fbc3dca3 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -258,10 +258,10 @@ def trailing_blank_lines(physical_line, lines, 
line_number, total_lines):
     """
     if line_number == total_lines:
         stripped_last_line = physical_line.rstrip()
-        if not stripped_last_line:
+        if physical_line and not stripped_last_line:
             return 0, "W391 blank line at end of file"
         if stripped_last_line == physical_line:
-            return len(physical_line), "W292 no newline at end of file"
+            return len(lines[-1]), "W292 no newline at end of file"
 
 
 @register_check

Reply via email to