assemblerflow / flowcraft

FlowCraft: a component-based pipeline composer for omics analysis using Nextflow. :whale::package:
GNU General Public License v3.0
241 stars 44 forks source link

Python3 syntax errors #219

Open t0rrant opened 5 years ago

t0rrant commented 5 years ago

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

cimendes commented 5 years ago

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

t0rrant commented 5 years ago

@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?

cimendes commented 5 years ago

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. :)