common-workflow-language / common-workflow-language/cwltool

cwltool expects string for envDef

Open
#1,148 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
376
Forks
255
Avg merge
2d 7h
Merged PRs (30d)
12

Description

this works:
```
cwlVersion: v1.0
class: CommandLineTool
baseCommand: env
requirements:
EnvVarRequirement:
envDef:
HELLO: hi
inputs: []
outputs: []
```
but if i change it to
```
cwlVersion: v1.0
class: CommandLineTool
baseCommand: env
requirements:
EnvVarRequirement:
envDef:
HELLO: 10
inputs: []
outputs: []
```
it breaks:
```
λ .venv3/bin/cwltool test.cwl
.venv3/bin/cwltool 1.0.20181217162649
Resolved 'test.cwl' to 'file:///home/gijs/Work/apercal/test.cwl'
Tool definition failed validation:
test.cwl:1:1: Object `test.cwl` is not valid because
tried `CommandLineTool` but
test.cwl:4:1: the `requirements` field is not valid because
tried array of but
test.cwl:5:3: item is invalid because
test.cwl:6:5: the `envDef` field is not valid because
test.cwl:7:7: item is invalid because
the `envValue` field is not valid because
- tried string but
the value is not string
- tried Expression but
value is a int but expected a string
```

It took me a while to figure it out, but 10 is automatically converted to a int type, which envDev doesn't like. Escaping the integer solves the problem, but is counterintuitive. Probably better to let envDef handle ints as well (automatically convert it to a string).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.