bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68559: [PATCH] Improve Python shell completion


From: Liu Hui
Subject: bug#68559: [PATCH] Improve Python shell completion
Date: Thu, 22 Feb 2024 18:31:00 +0800

On Wed, Feb 21, 2024 at 10:55 PM Basil L. Contovounesios
<basil@contovou.net> wrote:
>
> Liu Hui [2024-02-21 18:00 +0800] wrote:
>
> > The attached patch should fix the problem.
>
> Thanks!  The patch fixes the error, but that's because
> python-shell-completion-at-point-ipython is now skipped:

Only the native completion part is skipped for the reason below.

> in particular, python-shell-readline-completer-delims evaluates to
> "\s\t\n`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?" rather than the empty string.

"\s\t\n`..." is the delimiter used by rlcompleter, which is the
default completer used by the readline. rlcompleter cannot complete
module names or parameters, so in this case the native completion part
is skipped.

The test is intended to be used with Jedi as the completion backend,
e.g. setting PYTHONSTARTUP="$(python -m jedi repl)", or with a custom
IPython completer defined in the PYTHONSTARTUP file. I have updated the
patch to make the test use Jedi when possible.

> > -           (progn
> > -             (run-python nil t)
> > -             (insert ,contents)
> > -             (goto-char (point-min))
> > -             (python-tests-shell-wait-for-prompt)
> > -             ,@body)
> > +           ;; Prevent test failures when Jedi is used as a completion
> > +           ;; backend, either directly or indirectly (e.g., via
> > +           ;; IPython).  Jedi needs to store cache, but the
> > +           ;; "/nonexistent" HOME directory is not writable.
> > +           (ert-with-temp-directory cache-dir
>                                        ^^^^^^^^^
> Should this be an uninterned symbol instead?

Fixed.

Attachment: 0001-Fix-Python-shell-completion-test-failures.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]