[PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.

DoneSubmitted by Christopher Baines.
Details
2 participants
  • Christopher Baines
  • Marius Bakke
Owner
unassigned
Severity
normal
C
C
Christopher Baines wrote on 14 Jul 2019 00:01
(address . guix-patches@gnu.org)
20190713220102.7416-1-mail@cbaines.net
Patch from the upstream repository, seehttps://github.com/PyCQA/pycodestyle/issues/786for 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
Toggle diff (57 lines)diff --git a/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patch b/gnu/packages/patches/python-pep8-stdlib-tokenize-compat.patchnew file mode 100644index 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@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_checkdiff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scmindex 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
C
C
Christopher Baines wrote on 14 Jul 2019 00:17
Re: core-updates frozen!
(address . guix-devel@gnu.org)
87pnmdzijn.fsf@cbaines.net
I've sent a few patches to fix a couple of build issues on thecore-updates branch [1][2].
1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=366412: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36643
-----BEGIN PGP SIGNATURE-----
iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl0qWFxfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNFODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE9XcgNQ/7BDiCSo+ztV1HqWrjoXJFfNBHn3SDrI+JZHZQoq8A5UdgW/p5NO8B5XecRyGUj6z1I/auyWSrp3W5mWhaQ9xwvsF6wa8bhh/RP9RyCun/h7U2jgghYHHXXLKZSAs9CF47eDbYYLJBqvp59HNaLjv5uYIUn0RSkfDV9+KRMwEfedENdgEpnZtg8mtDviYHQoE7j26nDHIdIpnAUI93iu/CTK/s2gO2Vk2AGlBJoqzX5/G4BeWbtdv9QgtOzmJYZYM/84HpHEs2WOttbSnbG9Qvj1vb4eQY0S3TdXJ6c3FDpPGYvlWH74eoFBUXZjyKS5XbUfFDKXXtA/gTrbECd+bER6UCpbRrOXdZlZlNuwUFMXG5FGO2iFDTALjqWQGdlrNFwcKu3HFyIibDobXby+fsxtrPsLzyIDN9UsAUthFkzB4g9o6AUwrgNJPJY+aiFRnbKdeaauyaz4cMtd7Uhiy8muH+aZURCP8xSNjGQWImcglSfgoigWSJDoa2kCNjnr44Zd+h+kfHALrOU5S9CfEWIHrxob9JlWVQAT8JHM+Dg1FEEhDPBDE1YZgxWFNhaTQPe4OJ0kLaYX3RB/sJ2InjvSAu6TZQZjK0ipRNxC3Z1gNyHF5m4qiLbhhVv54DrBpVsrchIRTPUl8xIeBqZLQ/0EJ1CJEYB/22NaiLPACb0KE==AIC+-----END PGP SIGNATURE-----
M
M
Marius Bakke wrote on 14 Jul 2019 00:56
Re: [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.
87k1cllf1y.fsf@devup.no
Christopher Baines <mail@cbaines.net> writes:
Toggle quote (6 lines)> 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!
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0qYYkACgkQoqBt8qM6VPo8tQf8Cw6u83GRYfJyWSLXSB04yBxabIgenvvklJC7prbcWgbpFAFZHeVDalQWPEgwSBj1cPs/EAEo0Df+KoEQznchhMgEjemRufmKQxLhyC7EPft8VGZ9hJtZRZNLSCKp6xVAyodFdb5QZ92Iz5E0YnaOYoh+4xE08KJOnlxhPMCWnOFQl98B5eQ1YL6/N5+XKNeGPpxm4JM6HUNTJhdWWxpYxV2vVmXfcUCKJ8g8b1fk70ZYzN6zQW+voxKzJNFXWCL4wt8m8PYZV7XZcEdoL4XL9UT9k3wUcUyz5xXL4UvftXZXuuo9Ll3TonhNyB7SDC1PBVgiU9znHnepgKCHBYM3VQ===Egmo-----END PGP SIGNATURE-----
C
C
Christopher Baines wrote on 14 Jul 2019 10:10
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 36643-done@debbugs.gnu.org)
87v9w53ukw.fsf@cbaines.net
Marius Bakke <mbakke@fastmail.com> writes:
Toggle quote (10 lines)> Christopher Baines <mail@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.
-----BEGIN PGP SIGNATURE-----
iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl0q429fFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNFODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE9XeZkw//c0y5aZRpN1gRn6V3H9N36INHDwmMDUqf821otMZ6nIVT3tw5hrRghxMoP6NJMtEVX60Ele6adjK4KHc0DnxUl3AG/hi0yHxPAriFpsVC87KvWgQP8H2K9KoRWXRBEOz5Mi5dNMiWql8O6gyrRAJNgl1BlOhUAOPKq8oXt2cJjOcyaNXgI7QHWI1aGYWy4ghz5JMhflt1eGMrdX6FZWZWcQTQC6sltXbKhEf/ZRrvLtMVfCypK3s9RKc8K09GfUL+vAmpsj8GbQwgY0TWqiq7qsM9F3rN8WFIjUd9OOzocm3od0zEbPBLUvZhbUyMtpoMy3yQ6SAb8YMLdHsaJIvsCFT4rxl3H3yueiFERpnBcCi/DP04t0PjBU9ocwLlif0v+ulMWii9z6gIEii0j0eVYVl9uahMighc9+vop++SxX3Du0P+novbUmpIggpHAjKAvkAsi1NL299QxCu5X7VW352wXhWh7DkpfDBsgGLhmpcln8GYYXBfZEcm0ulyuXSTqcOWgtuh0zHzpMY38Llmn3MZATBhFJT2uZv3z4lu2p7Q0qZyHbiQL5BBLmuM12Hrxdhbuoq3cKY0Gc56HMgAMrzmu/mrJqALkqYNDq5sKMf/KRjpCJmxpHM+DdIjDhDj55AviAgxtVb/Lyf5NEnz3cFWcafcW/SpObN4l2OhgAU==NJIq-----END PGP SIGNATURE-----
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 36643@debbugs.gnu.org