common-workflow-language / cwltool

Common Workflow Language reference implementation
https://cwltool.readthedocs.io/
Apache License 2.0
332 stars 230 forks source link

Upgrading to latest version of cwl-runner breaks command line inputs #69

Closed prismofeverything closed 8 years ago

prismofeverything commented 8 years ago

The previous version of cwl-runner I could do this:

cwl-runner cat.cwl --input README.md 

using the following workflow (performs a simple cat):

#!/usr/bin/env cwl-runner
cwlVersion: "cwl:draft-3"
class: CommandLineTool
description: "This tool is developed for SMC-RNA Challenge for detecting gene fusions (STAR fusion)"
inputs:
  #Give it a list of input files
  - id: input
    type: File
    inputBinding:
      position: 0 
outputs:
  - id: output
    type: File
    outputBinding:
      glob: test.txt
stdout: test.txt
baseCommand: [cat]

and I would get a result:

Final process status is success
{
    "output": {
        "size": 68, 
        "path": "/Users/spanglry/Code/importers/test.txt", 
        "checksum": "sha1$3f9848f75373e501d9832e9d47899b6ee3cfa780", 
        "class": "File"
    }
}

And the contents of README.md would be present in the output file test.txt.

Today I upgraded to the latest cwl-runner and the exact same process now fails!

/usr/local/bin/cwl-runner 1.0.20160425140546
Traceback (most recent call last):
  File "/usr/local/bin/cwl-runner", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/cwltool/main.py", line 590, in main
    stdout=stdout)
  File "/usr/local/lib/python2.7/site-packages/cwltool/main.py", line 434, in load_job_order
    cmd_line = vars(toolparser.parse_args(args.job_order))
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1701, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1733, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1939, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1879, in consume_optional
    take_action(action, args, option_string)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 1807, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.py", line 802, in __call__
    raise NotImplementedError(_('.__call__() not defined'))
NotImplementedError: .__call__() not defined

Any idea what happened?

mr-c commented 8 years ago

Hello @prismofeverything, thank you for your report.

Do you know which version of cwltool worked previously?

prismofeverything commented 8 years ago

This was the one:

/usr/local/bin/cwl-runner 1.0.20160310140736

mr-c commented 8 years ago

Then 021d3fdccb86ff4fd3ee0a5322839f23d05e745b is the commit that worked; I'm looking into it now.

mr-c commented 8 years ago

Oh, git bisect you are efficient and cruel: a3d24f8da648befae983fe9f1b995713fdfcb28f is the first bad commit

commit a3d24f8da648befae983fe9f1b995713fdfcb28f
Author: Michael R. Crusoe <crusoe@ucdavis.edu>
Date:   Tue Mar 29 02:41:31 2016 -0700

    add type hints
mr-c commented 8 years ago

Fixed in https://github.com/common-workflow-language/cwltool/commit/a85f8fdab45433e2378ba576a48f4a99a98b1b23 including a test using your sample code. Thank you for the test case!

Sorry for the bother.

prismofeverything commented 8 years ago

Not at all, thanks for your speedy response!