GNU bug report logs - #36643
[PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sat, 13 Jul 2019 22:02:06 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36643 in the body.
You can then email your comments to 36643 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#36643; Package guix-patches. (Sat, 13 Jul 2019 22:02:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 13 Jul 2019 22:02:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python
 3.7.
Date: Sat, 13 Jul 2019 23:01:01 +0100
Patch from the upstream repository, see
https://github.com/PyCQA/pycodestyle/issues/786 for more details.

* gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch: New file.
* gnu/packages/python-xyz.scm (python-pep8)[source]: Add it.
---
 .../python-pep8-stdlib-tokenize-compat.patch  | 35 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  3 +-
 2 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch

diff --git a/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch b/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch
new file mode 100644
index 0000000000..f11d8f7be8
--- /dev/null
+++ b/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch
@@ -0,0 +1,35 @@
+From 397463014fda3cdefe8d6c9d117ae16d878dc494 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson <at> canonical.com>
+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/pep8.py
++++ b/pep8.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
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a60e1c7e2a..ac43ef9057 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6350,7 +6350,8 @@ applications.")
         (uri (pypi-uri "pep8" version))
         (sha256
           (base32
-            "002rkl4lsn6x2mxmf8ar00l0m8i3mzrc6pnzz77blyksmpsxa4x1"))))
+           "002rkl4lsn6x2mxmf8ar00l0m8i3mzrc6pnzz77blyksmpsxa4x1"))
+        (patches (search-patches "python-pep8-stdlib-tokenize-compat.patch"))))
     (build-system python-build-system)
     (home-page "https://pep8.readthedocs.org/")
     (synopsis "Python style guide checker")
-- 
2.22.0





Information forwarded to guix-patches <at> gnu.org:
bug#36643; Package guix-patches. (Sat, 13 Jul 2019 22:18:03 GMT) Full text and rfc822 format available.

Message #8 received at 36643 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-devel <at> gnu.org
Cc: 36641 <at> debbugs.gnu.org, 36643 <at> debbugs.gnu.org
Subject: Re: core-updates frozen!
Date: Sat, 13 Jul 2019 23:17:00 +0100
[Message part 1 (text/plain, inline)]
I've sent a few patches to fix a couple of build issues on the
core-updates branch [1][2].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36641
2: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36643
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#36643; Package guix-patches. (Sat, 13 Jul 2019 22:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 36643 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Christopher Baines <mail <at> cbaines.net>, 36643 <at> debbugs.gnu.org
Subject: Re: [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test
 failure with Python 3.7.
Date: Sun, 14 Jul 2019 00:56:09 +0200
[Message part 1 (text/plain, inline)]
Christopher Baines <mail <at> cbaines.net> writes:

> Patch from the upstream repository, see
> https://github.com/PyCQA/pycodestyle/issues/786 for more details.
>
> * gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch: New file.
> * gnu/packages/python-xyz.scm (python-pep8)[source]: Add it.

LGTM, thanks!
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Sun, 14 Jul 2019 08:11:02 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Sun, 14 Jul 2019 08:11:02 GMT) Full text and rfc822 format available.

Message #16 received at 36643-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 36643-done <at> debbugs.gnu.org
Subject: Re: [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test
 failure with Python 3.7.
Date: Sun, 14 Jul 2019 09:10:23 +0100
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Christopher Baines <mail <at> cbaines.net> writes:
>
>> Patch from the upstream repository, see
>> https://github.com/PyCQA/pycodestyle/issues/786 for more details.
>>
>> * gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch: New file.
>> * gnu/packages/python-xyz.scm (python-pep8)[source]: Add it.
>
> LGTM, thanks!

Great, I've pushed this now.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 11 Aug 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.