Skip to content

Commit

Permalink
completions/setup: Require prompt_toolkit <2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mdraw committed Jul 5, 2018
1 parent a1bb996 commit dfd0970
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions elektronn2/utils/ptk_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@

import jedi
from prompt_toolkit.completion import Completer, Completion
try: # prompt_toolkit 2.*
from prompt_toolkit.completion import PathCompleter
except ImportError: # prompt_toolkit 1.*
try:
from prompt_toolkit.contrib.completers import PathCompleter
except ImportError as e: # prompt_toolkit 2.*
print('\n\n\nprompt_toolkit 2 is not supported. Please downgrade to prompt_toolkit<2.\n\n\n')
raise e

from prompt_toolkit.contrib.regular_languages.compiler import \
compile as compile_grammar
from prompt_toolkit.contrib.regular_languages.completion import \
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ numba>=0.25
colorlog>=2.7
pydotplus
seaborn
prompt_toolkit>=1.0.3
prompt_toolkit>=1.0.3,<2
jedi>=0.9.0
psutil>=5.0.1

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def read(fname):
'future>=0.15',
'tqdm>=4.5',
'colorlog>=2.7',
'prompt_toolkit>=1.0.3',
'prompt_toolkit>=1.0.3,<2',
'jedi>=0.9.0',
'pydotplus',
'seaborn',
Expand Down

0 comments on commit dfd0970

Please sign in to comment.