diff options
author | Ruslan Makhmatkhanov <rm@FreeBSD.org> | 2021-01-19 08:35:04 +0000 |
---|---|---|
committer | Ruslan Makhmatkhanov <rm@FreeBSD.org> | 2021-01-19 08:35:04 +0000 |
commit | a6bbf72ad7a1bd00bbd2249bdd65d4534eb8a550 (patch) | |
tree | 635885e3b972d699461735c1d793db726d2fb93b /devel/ipython | |
parent | 352da80b910140aee34b4869d47467e8a18aa777 (diff) | |
download | ports-a6bbf72ad7a1bd00bbd2249bdd65d4534eb8a550.tar.gz ports-a6bbf72ad7a1bd00bbd2249bdd65d4534eb8a550.zip |
devel/ipython: add upstream fix
Autocompletion is broken in ipython, that is currently in ports.
Add adopted upstream commit to resolve the issue.
Reference:
https://github.com/ipython/ipython/issues/12740
With hat: python
Notes
Notes:
svn path=/head/; revision=562034
Diffstat (limited to 'devel/ipython')
-rw-r--r-- | devel/ipython/Makefile | 2 | ||||
-rw-r--r-- | devel/ipython/files/patch-autocompletion-fix | 74 |
2 files changed, 75 insertions, 1 deletions
diff --git a/devel/ipython/Makefile b/devel/ipython/Makefile index af3f04179ea6..3c99e640fb7c 100644 --- a/devel/ipython/Makefile +++ b/devel/ipython/Makefile @@ -3,7 +3,7 @@ PORTNAME= ipython PORTVERSION= 7.19.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff --git a/devel/ipython/files/patch-autocompletion-fix b/devel/ipython/files/patch-autocompletion-fix new file mode 100644 index 000000000000..a53dc1cc465a --- /dev/null +++ b/devel/ipython/files/patch-autocompletion-fix @@ -0,0 +1,74 @@ +From dcd9dc90aee7e4c5c52ce44c18e7518934790612 Mon Sep 17 00:00:00 2001 +From: gorogoroumaru <force.minpiku@gmail.com> +Date: Fri, 10 Apr 2020 10:24:52 +0900 +Subject: [PATCH] Fix DeprecationWarning on autocompletion with jedi 0.17.0 + +--- + IPython/core/completer.py | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +diff --git a/IPython/core/completer.py b/IPython/core/completer.py +index 16fbb81f55..01730fff2d 100644 +--- IPython/core/completer.py ++++ IPython/core/completer.py +@@ -110,26 +110,23 @@ + # Copyright (C) 2001 Python Software Foundation, www.python.org + + +-import __main__ + import builtins as builtin_mod + import glob +-import time + import inspect + import itertools + import keyword + import os + import re ++import string + import sys ++import time + import unicodedata +-import string + import warnings +- + from contextlib import contextmanager + from importlib import import_module +-from typing import Iterator, List, Tuple, Iterable + from types import SimpleNamespace ++from typing import Iterable, Iterator, List, Tuple + +-from traitlets.config.configurable import Configurable + from IPython.core.error import TryNext + from IPython.core.inputtransformer2 import ESC_MAGIC + from IPython.core.latex_symbols import latex_symbols, reverse_latex_symbol +@@ -137,7 +134,10 @@ + from IPython.utils import generics + from IPython.utils.dir2 import dir2, get_real_method + from IPython.utils.process import arg_split +-from traitlets import Bool, Enum, observe, Int ++from traitlets import Bool, Enum, Int, observe ++from traitlets.config.configurable import Configurable ++ ++import __main__ + + # skip module docstests + skip_doctest = True +@@ -1380,8 +1380,7 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str): + else: + raise ValueError("Don't understand self.omit__names == {}".format(self.omit__names)) + +- interpreter = jedi.Interpreter( +- text[:offset], namespaces, column=cursor_column, line=cursor_line + 1) ++ interpreter = jedi.Interpreter(text[:offset], namespaces) + try_jedi = True + + try: +@@ -1408,7 +1407,7 @@ def _jedi_matches(self, cursor_column:int, cursor_line:int, text:str): + if not try_jedi: + return [] + try: +- return filter(completion_filter, interpreter.completions()) ++ return filter(completion_filter, interpreter.complete(column=cursor_column, line=cursor_line + 1)) + except Exception as e: + if self.debug: + return [_FakeJediCompletion('Oops Jedi has crashed, please report a bug with the following:\n"""\n%s\ns"""' % (e))] |