TACC-Cloud / agave-cli

The Tapis CLI
Other
4 stars 8 forks source link

replaced tab with spaces and updated print statements to be compatibl… #46

Closed georgebzheng closed 5 years ago

georgebzheng commented 5 years ago

…e with Python3

mwes commented 5 years ago

FYI @johnfonner @mwvaughn George (from Netrias) found this issue working through the SD2 documentation (specifically the auth-switch command)

alejandrox1 commented 5 years ago

@georgebzheng @mwes how did you come across bin/libs/python/richtext.py ? Where is it used?

mwes commented 5 years ago

This occurs for me when running the CLI command auth-switch

alejandrox1 commented 5 years ago

@mwes can you post the error message? Along with the version of python that you are using?

mwes commented 5 years ago

Sure thing. Example below. I am using python 3.6.4

auth-switch
  File "/Users/markweston/Documents/sd2e_new_cli/sd2e-cloud-cli/bin/libs/python/richtext.py", line 17
    result="| "
              ^
TabError: inconsistent use of tabs and spaces in indentation

This is pretty easy to verify in the original source - you can see the mix of tabs and spaces: image

After you fix those issues, the print statement will complain.

alejandrox1 commented 5 years ago

@mwes does the error persist if you use python 2.X?

mwes commented 5 years ago

I get a different error on a py2 virtualenv. I am not seeing errors with other CLI commands, just this one. Regardless of py2/py3, I wouldn't be mixing tabs and spaces in a python file, and the change to print() is forward looking for python3 compatibility, if this is of interest.

(py2) ➜  ~ auth-switch         
Unable to read /Users/markweston/.agave/current#name
Unable to read /Users/markweston/.agave/'basestring'
Unable to read /Users/markweston/.agave/is
Unable to read /Users/markweston/.agave/not
Unable to read /Users/markweston/.agave/defined#name
Unable to read /Users/markweston/.agave/'basestring'
Unable to read /Users/markweston/.agave/is
Unable to read /Users/markweston/.agave/not
Unable to read /Users/markweston/.agave/defined
list index out of range
(py2) ➜  ~ auth-check 
tenant: sd2e
username: mweston
time left: 13897 seconds
expires at: Wed Sep 12 16:22:05 EDT 2018
alejandrox1 commented 5 years ago

@mwes haha that's a cool error. More importably, thank you for all your feedback! I will leave this pr open for a couple more weeks while we work on the next release and merge it.

mwes commented 5 years ago

@georgebzheng can you review the conflict here? Was this fixed upstream?

alejandrox1 commented 5 years ago

Closing this pr because of #56

mwes commented 5 years ago

@alejandrox1 can you clarify? https://github.com/TACC-Cloud/agave-cli/issues/56 has no development against it from what I can see.