Skip to content

Commit dfd0970

Browse files
committed
completions/setup: Require prompt_toolkit <2
Turns out that there are a couple of other (non-fatal) breaking changes in ptk 2 that limit the usefulness of the shell, so we just require v1 now.
1 parent a1bb996 commit dfd0970

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

elektronn2/utils/ptk_completions.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747

4848
import jedi
4949
from prompt_toolkit.completion import Completer, Completion
50-
try: # prompt_toolkit 2.*
51-
from prompt_toolkit.completion import PathCompleter
52-
except ImportError: # prompt_toolkit 1.*
50+
try:
5351
from prompt_toolkit.contrib.completers import PathCompleter
52+
except ImportError as e: # prompt_toolkit 2.*
53+
print('\n\n\nprompt_toolkit 2 is not supported. Please downgrade to prompt_toolkit<2.\n\n\n')
54+
raise e
55+
5456
from prompt_toolkit.contrib.regular_languages.compiler import \
5557
compile as compile_grammar
5658
from prompt_toolkit.contrib.regular_languages.completion import \

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ numba>=0.25
1111
colorlog>=2.7
1212
pydotplus
1313
seaborn
14-
prompt_toolkit>=1.0.3
14+
prompt_toolkit>=1.0.3,<2
1515
jedi>=0.9.0
1616
psutil>=5.0.1
1717

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def read(fname):
5454
'future>=0.15',
5555
'tqdm>=4.5',
5656
'colorlog>=2.7',
57-
'prompt_toolkit>=1.0.3',
57+
'prompt_toolkit>=1.0.3,<2',
5858
'jedi>=0.9.0',
5959
'pydotplus',
6060
'seaborn',

0 commit comments

Comments
 (0)