rabix / cwl-format

A very opinionated code formatter for CWL
Apache License 2.0
9 stars 4 forks source link

How can I get cwlformat to work on Py3.5 #10

Closed ambarishK closed 4 years ago

ambarishK commented 4 years ago

There is an error in cwl-format.

(env) ngsap2@ubuntu:~/cwl-format$ cwl-format /home/ngsap2/alignmentDocker.cwl > alignmentNewDocker.cwl
Traceback (most recent call last):
  File "/home/ngsap2/.local/bin/cwl-format", line 7, in <module>
    from cwlformat.formatter import main
  File "/home/ngsap2/.local/lib/python3.5/site-packages/cwlformat/formatter.py", line 105
    description=f"Rabix/cwl-format v{__version__}\n"
                                                   ^
SyntaxError: invalid syntax
ghost commented 4 years ago

Hi @ambarishK , sorry you are having this problem.

I see you are on Python 3.5. cwlformat needs at least Py 3.6. It is set in the setup.py but pip apparently ignores this.

If you can not use Py3.6 or higher you can use pipx to install cwlformat.

You can do this as follows:

pip install pipx  # from your < py3.6 environment
pipx ensurepath # ensures CLI application directory is on your $PATH
pipx install cwlformat --python python3.7 #tells pipx to set up a Py3.7 env for this app

Please tell me if this works for you.

Thanks -Kaushik

ambarishK commented 4 years ago

Yes sir. I changed my python environment from python 3.5 to python 3.6 and updated dependencies after installing setup.py.

It is working fine now.

Thank you so much sir.

ghost commented 4 years ago

You are most welcome @ambarishK .