awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.19k stars 775 forks source link

AssertionError with the newest dependencies #106

Closed karolyi closed 8 years ago

karolyi commented 8 years ago

Hey guys,

aws-shell fails to start when installed with the newest dependencies. The traceback is:

Creating doc index in the background. It will be a few minutes before all documentation is available.
Traceback (most recent call last):
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/bin/aws-shell", line 11, in <module>
    sys.exit(main())
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/awsshell/__init__.py", line 70, in main
    shell.run()
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/awsshell/app.py", line 275, in run
    document = self.cli.run()
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/awsshell/app.py", line 268, in cli
    self._cli = self.create_cli_interface(self.show_completion_columns)
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/awsshell/app.py", line 452, in create_cli_interface
    display_completions_in_columns)
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/awsshell/app.py", line 420, in create_application
    key_bindings_registry=self.key_manager.manager.registry,
  File "/Users/laszlokarolyi/Work/immoscout/taupage/venv/lib/python2.7/site-packages/prompt_toolkit/application.py", line 110, in __init__
    assert style is None or isinstance(style, Style)
AssertionError
jamesls commented 8 years ago

Interesting. I'm not seeing that issue. What version of prompt_toolkit do you have? pip freeze | grep prompt. I tried:

$ virtualenv /tmp/venv
$ . /tmp/venv/bin/activate
(venv) $ pip install aws-shell
(venv) $ aws-shell
Creating doc index in the background. It will be a few minutes before all documentation is available.
aws>
karolyi commented 8 years ago

Hey,

my version of prompt-toolkit is: prompt-toolkit==0.57

karolyi commented 8 years ago

addition: I removed the complete ~/.aws/shell directory to see if it was a misconfiguration, but the error still persists.

hjpotter92 commented 8 years ago

I am having the same issue. My OS is debian-8. prompt_toolkit version: 0.52

The same error occurs when I do the following:

▶ virtualenv /tmp/ve
▶ . /tmp/ve/bin/activate
▶ pip install aws-shell
...
▶ aws-shell

The result is:

(ve) ▶ aws-shell
Creating doc index in the background. It will be a few minutes before all documentation is available.
Traceback (most recent call last):
  File "/usr/local/bin/aws-shell", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/awsshell/__init__.py", line 70, in main
    shell.run()
  File "/usr/local/lib/python2.7/dist-packages/awsshell/app.py", line 275, in run
    document = self.cli.run()
  File "/usr/local/lib/python2.7/dist-packages/awsshell/app.py", line 268, in cli
    self._cli = self.create_cli_interface(self.show_completion_columns)
  File "/usr/local/lib/python2.7/dist-packages/awsshell/app.py", line 452, in create_cli_interface
    display_completions_in_columns)
  File "/usr/local/lib/python2.7/dist-packages/awsshell/app.py", line 420, in create_application
    key_bindings_registry=self.key_manager.manager.registry,
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/application.py", line 110, in __init__
    assert style is None or isinstance(style, Style)
AssertionError
hjpotter92 commented 8 years ago

Weirdly, degrading coloroma from 0.3.6 to 0.3.3 resolves the error.

jamesls commented 8 years ago

I think this is now fixed with the latest version of the shell which pulls in v1.0.0 of the prompt-prompt-toolkit. Let me know if you're still seeing these issues.

karolyi commented 8 years ago

aside from the fact that the required dependencies are old ...

rsa<=3.3.0,>=3.1.2 where rsa is at 3.4.2 colorama<=0.3.3,>=0.2.5 where colorama is at 0.3.7

... the bug has been fixed.

jamesls commented 8 years ago

Yes, I believe those are being pulled in via the AWS CLI, we should be able to update RSA, but colorama had a backwards incompatible change the last time we looked. We'll need to see if there's anything we can do in the CLI to preserve backwards compatibility.