unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.
@ 2019-07-13 22:01 Christopher Baines
  2019-07-13 22:01 ` [bug#36642] [PATCH 2/2] gnu: python-gst: Fix build failure Christopher Baines
  2019-07-13 22:56 ` [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Marius Bakke
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher Baines @ 2019-07-13 22:01 UTC (permalink / raw)
  To: 36643

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@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#36642] [PATCH 2/2] gnu: python-gst: Fix build failure.
  2019-07-13 22:01 [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Christopher Baines
@ 2019-07-13 22:01 ` Christopher Baines
  2019-07-13 22:12   ` bug#36642: " Christopher Baines
  2019-07-13 22:56 ` [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Marius Bakke
  1 sibling, 1 reply; 5+ messages in thread
From: Christopher Baines @ 2019-07-13 22:01 UTC (permalink / raw)
  To: 36642

Building python-gst fails with:

  Unbound variable: python-version

Therefore, add python-build-system to #:modules so that it's imported, and
give it a prefix to avoid clashing with the gnu-build-system.

Also, simplify the code by using the site-packages function from the
python-build-system module.

* gnu/packages/gstreamer.scm (python-gst)[arguments]: Rework to fix build
failure.
---
 gnu/packages/gstreamer.scm | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index b0f0b032b3..efb9a6f796 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -431,17 +431,14 @@ compression formats through the use of the libav library.")
                 "0f1d9rvy2qxlymmfzyknnfr5rz1vx69jv17gp7wnamc5s6p7mp2m"))))
     (build-system gnu-build-system)
     (arguments
-     ;; XXX: Factorize python-sitedir with python-build-system.
-     `(#:imported-modules (,@%gnu-build-system-modules
+     `(#:modules ((guix build gnu-build-system)
+                  ((guix build python-build-system) #:prefix python:))
+       #:imported-modules (,@%gnu-build-system-modules
                            (guix build python-build-system))
        #:configure-flags
-       (let* ((python (assoc-ref %build-inputs "python"))
-              (python-version (python-version python))
-              (python-sitedir (string-append
-                               "lib/python" python-version "/site-packages")))
-         (list (string-append
-                "--with-pygi-overrides-dir=" %output "/" python-sitedir
-                "/gi/overrides")))))
+       (list (string-append
+              "--with-pygi-overrides-dir=" %output "/"
+              (python:site-packages %build-inputs %outputs) "/gi/overrides"))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("python" ,python)))
-- 
2.22.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#36642: [PATCH 2/2] gnu: python-gst: Fix build failure.
  2019-07-13 22:01 ` [bug#36642] [PATCH 2/2] gnu: python-gst: Fix build failure Christopher Baines
@ 2019-07-13 22:12   ` Christopher Baines
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Baines @ 2019-07-13 22:12 UTC (permalink / raw)
  To: 36642-done

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

Closing, as this is a duplicate of [1].

1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36641

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.
  2019-07-13 22:01 [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Christopher Baines
  2019-07-13 22:01 ` [bug#36642] [PATCH 2/2] gnu: python-gst: Fix build failure Christopher Baines
@ 2019-07-13 22:56 ` Marius Bakke
  2019-07-14  8:10   ` bug#36643: " Christopher Baines
  1 sibling, 1 reply; 5+ messages in thread
From: Marius Bakke @ 2019-07-13 22:56 UTC (permalink / raw)
  To: Christopher Baines, 36643

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

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!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#36643: [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7.
  2019-07-13 22:56 ` [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Marius Bakke
@ 2019-07-14  8:10   ` Christopher Baines
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Baines @ 2019-07-14  8:10 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 36643-done

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]


Marius Bakke <mbakke@fastmail.com> writes:

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-14  8:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-13 22:01 [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Christopher Baines
2019-07-13 22:01 ` [bug#36642] [PATCH 2/2] gnu: python-gst: Fix build failure Christopher Baines
2019-07-13 22:12   ` bug#36642: " Christopher Baines
2019-07-13 22:56 ` [bug#36643] [PATCH 1/2] gnu: python-pep8: Patch to fix test failure with Python 3.7 Marius Bakke
2019-07-14  8:10   ` bug#36643: " Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).