flowcraft icon indicating copy to clipboard operation
flowcraft copied to clipboard

Python3 syntax errors

Open t0rrant opened this issue 5 years ago • 3 comments

Usage of print as a macro, i.e https://github.com/assemblerflow/flowcraft/blob/master/flowcraft/bin/renamePE_samtoolsFASTQ.py#L98:

print 'Runtime :' + str(hours) + 'h:' + str(minutes) + 'm:' + str(round(seconds, 2)) + 's'

is not allowed, all print '<string>' references should be updated to print('<string>') formatted or python3 installation fails:

# python3 setup.py install
...
byte-compiling build/bdist.linux-x86_64/egg/flowcraft/bin/renamePE_samtoolsFASTQ.py to renamePE_samtoolsFASTQ.cpython-35.pyc
  File "build/bdist.linux-x86_64/egg/flowcraft/bin/renamePE_samtoolsFASTQ.py", line 98
     print 'Runtime :' + str(hours) + 'h:' + str(minutes) + 'm:' + str(round(seconds, 2)) + 's'
                     ^
SyntaxError: invalid syntax

This and other fixes can be automatically applied by using 2to3

t0rrant avatar Aug 16 '19 17:08 t0rrant

This is a case of a misplaced template script that should not be in the bin folder. Thank you for reporting this! :)

cimendes avatar Aug 16 '19 17:08 cimendes

@cimendes is this just a case of removing that template script, as it is not actually needed, or is it supposed to be moved to another location?

t0rrant avatar Sep 09 '19 12:09 t0rrant

Hi! This file right here should be rewritten and added as a propper template (moving to flowcraft/templates/) instead of sneakily living in the bin folder. :)

cimendes avatar Sep 09 '19 12:09 cimendes