unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#50074] [PATCH core-updates-frozen] gnu: bpython: Fix test failure.
@ 2021-08-16  2:41 Noah Evans
  2021-08-16  7:07 ` bug#50074: " Mathieu Othacehe
  0 siblings, 1 reply; 2+ messages in thread
From: Noah Evans @ 2021-08-16  2:41 UTC (permalink / raw)
  To: 50074

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

Updating jedi causes a bpython test to fail. I attached a patch backporting the required bpython changes. Alternatively, bpython's version could be bumped, or jedi could be removed from its dependencies.

From d2611d5a1afe83ad16a8d0b1810c340a765d6284 Mon Sep 17 00:00:00 2001
From: Noah Evans <noah@nevans.me>
Date: Sun, 15 Aug 2021 22:20:00 -0400
Subject: [[PATCH core-updates-frozen]] gnu: bpython: Fix test failure.

---
.../patches/bpython-jedi-update.patch | 32 +++++++++++++++++++
gnu/packages/python-xyz.scm | 3 +-
2 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/bpython-jedi-update.patch

diff --git a/gnu/packages/patches/bpython-jedi-update.patch b/gnu/packages/patches/bpython-jedi-update.patch
new file mode 100644
index 0000000000..dee648d83e
--- /dev/null
+++ b/gnu/packages/patches/bpython-jedi-update.patch
@@ -0,0 +1,32 @@
+Taken from this commit on bpython: https://github.com/bpython/bpython/commit/1cfba80da898c54334521318e232f0d31cac7051
+
+diff --git a/bpython/autocomplete.py b/bpython/autocomplete.py
+index b0508bc9..a06776f6 100644
+--- a/bpython/autocomplete.py
++++ b/bpython/autocomplete.py
+@@ -520,9 +520,9 @@ def matches(self, cursor_offset, line, **kwargs):
+
+ try:
+ script = jedi.Script(
+- history, len(history.splitlines()), cursor_offset, "fake.py"
++ history, path="fake.py"
+ )
+- completions = script.completions()
++ completions = script.complete(len(history.splitlines()), cursor_offset)
+ except (jedi.NotFoundError, IndexError, KeyError):
+ # IndexError for #483
+ # KeyError for #544
+diff --git a/bpython/test/test_autocomplete.py b/bpython/test/test_autocomplete.py
+index 65beb011..28243577 100644
+--- a/bpython/test/test_autocomplete.py
++++ b/bpython/test/test_autocomplete.py
+@@ -367,7 +367,7 @@ def matches_from_completions(
+ ):
+ with mock.patch("bpython.autocomplete.jedi.Script") as Script:
+ script = Script.return_value
+- script.completions.return_value = completions
++ script.complete.return_value = completions
+ com = autocomplete.MultilineJediCompletion()
+ return com.matches(
+ cursor, line, current_block=block, history=history
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c8b3777f8f..2a86d2bb3c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20015,7 +20015,8 @@ Included are implementations of:
(method url-fetch)
(uri (pypi-uri "bpython" version))
(sha256
- (base32 "00vmkkc79mlnkyvwww1cr7bpwmf4p61704dhayz6kd0kc203hxvf"))))
+ (base32 "00vmkkc79mlnkyvwww1cr7bpwmf4p61704dhayz6kd0kc203hxvf"))
+ (patches (search-patches "bpython-jedi-update.patch"))))
(build-system python-build-system)
(arguments
`(#:phases
--
2.32.0

[-- Attachment #2: Type: text/html, Size: 5749 bytes --]

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

* bug#50074: [PATCH core-updates-frozen] gnu: bpython: Fix test failure.
  2021-08-16  2:41 [bug#50074] [PATCH core-updates-frozen] gnu: bpython: Fix test failure Noah Evans
@ 2021-08-16  7:07 ` Mathieu Othacehe
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2021-08-16  7:07 UTC (permalink / raw)
  To: Noah Evans; +Cc: 50074-done


Hello Noah,

> Updating jedi causes a bpython test to fail. I attached a patch
> backporting the required bpython changes. Alternatively, bpython's
> version could be bumped, or jedi could be removed from its
> dependencies.

Thanks for the patch! I preferred to update bpython to the 0.21 release
that includes the required patch with
591a3f5714231b0820d5814299d90dc92af6e585.

Mathieu




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

end of thread, other threads:[~2021-08-16  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-16  2:41 [bug#50074] [PATCH core-updates-frozen] gnu: bpython: Fix test failure Noah Evans
2021-08-16  7:07 ` bug#50074: " Mathieu Othacehe

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