From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54987) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmQ5o-0002xE-8e for guix-patches@gnu.org; Sat, 13 Jul 2019 18:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmQ5m-0006x3-SC for guix-patches@gnu.org; Sat, 13 Jul 2019 18:02:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34670) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmQ5m-0006wo-P2 for guix-patches@gnu.org; Sat, 13 Jul 2019 18:02:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmQ5m-0008DH-My for guix-patches@gnu.org; Sat, 13 Jul 2019 18:02:06 -0400 Subject: [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:54511) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmQ4o-0002k5-5h for guix-patches@gnu.org; Sat, 13 Jul 2019 18:01:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmQ4m-0005nV-Bj for guix-patches@gnu.org; Sat, 13 Jul 2019 18:01:05 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:60074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hmQ4m-0005li-63 for guix-patches@gnu.org; Sat, 13 Jul 2019 18:01:04 -0400 Received: from localhost (148.185.93.209.dyn.plus.net [209.93.185.148]) by mira.cbaines.net (Postfix) with ESMTPSA id F28941721C for ; Sat, 13 Jul 2019 23:01:02 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id f1b7e53c for ; Sat, 13 Jul 2019 22:01:02 +0000 (UTC) From: Christopher Baines Date: Sat, 13 Jul 2019 23:01:01 +0100 Message-Id: <20190713220102.7416-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36643@debbugs.gnu.org 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-comp= at.patch diff --git a/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patc= h 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 +Date: Tue, 25 Sep 2018 14:58:57 +1200 +Subject: [PATCH] Keep compability with stdlib tokenize.py changes + +https://github.com/python/cpython/commit/c4ef4896eac86a6759901c8546e26de= 4695a1389 +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, lin= e_number, total_lines): + """ + if line_number =3D=3D total_lines: + stripped_last_line =3D 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 =3D=3D physical_line: +- return len(physical_line), "W292 no newline at end of file" ++ return len(lines[-1]), "W292 no newline at end of file" +=20 +=20 + @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.pat= ch")))) (build-system python-build-system) (home-page "https://pep8.readthedocs.org/") (synopsis "Python style guide checker") --=20 2.22.0