You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the reference implementation of the Common Workflow Language. It is
13
-
intended to be feature complete and provide comprehensive validation of CWL
11
+
intended to feature complete and provide comprehensive validation of CWL
14
12
files as well as provide other tools related to working with CWL.
15
13
16
-
This is written and tested for Python 2.7.
14
+
This is written and tested for Python ``2.7 and 3.x {x = 3, 4, 5, 6}``
17
15
18
-
The reference implementation consists of two packages. The "cwltool" package
16
+
The reference implementation consists of two packages. The ``cwltool`` package
19
17
is the primary Python module containing the reference implementation in the
20
-
"cwltool" module and console executable by the same name.
18
+
``cwltool`` module and console executable by the same name.
21
19
22
-
The "cwlref-runner" package is optional and provides an additional entry point
23
-
under the alias "cwl-runner", which is the implementation-agnostic name for the
20
+
The ``cwlref-runner`` package is optional and provides an additional entry point
21
+
under the alias ``cwl-runner``, which is the implementation-agnostic name for the
24
22
default CWL interpreter installed on a host.
25
23
26
24
Install
@@ -33,7 +31,7 @@ It is highly recommended to setup virtual environment before installing `cwltool
33
31
virtualenv -p python2 venv # Create a virtual environment, can use `python3` as well
34
32
source venv/bin/activate # Activate environment before installing `cwltool`
35
33
36
-
1. Installing the official package from PyPi (will install "cwltool" package as
34
+
Installing the official package from PyPi (will install "cwltool" package as
37
35
well)
38
36
39
37
.. code:: bash
@@ -46,7 +44,7 @@ If installing alongside another CWL implementation then
46
44
47
45
pip install cwltool
48
46
49
-
2. To install from source
47
+
Or you can install from source:
50
48
51
49
.. code:: bash
52
50
@@ -64,9 +62,22 @@ Running tests locally
64
62
65
63
- Running basic tests ``(/tests)``:
66
64
65
+
To run the basis tests after installing `cwltool` execute the following:
66
+
67
67
.. code:: bash
68
68
69
-
python setup.py test
69
+
pip install pytest mock
70
+
py.test --ignore cwltool/schemas/ --pyarg cwltool
71
+
72
+
To run various tests in all supported Python environments we use `tox <https://github.com/common-workflow-language/cwltool/tree/master/tox.ini>`_. To run the test suite in all supported Python environments
73
+
first downloading the complete code repository (see the ``git clone`` instructions above) and then run
74
+
the following in the terminal:
75
+
``pip install tox; tox``
76
+
77
+
List of all environment can be seen using:
78
+
``tox --listenvs``
79
+
and running a specfic test env using:
80
+
``tox -e <env name>``
70
81
71
82
- Running the entire suite of CWL conformance tests:
72
83
@@ -102,6 +113,32 @@ and ``--tmp-outdir-prefix`` to somewhere under ``/Users``::
Unfortunately, this documentation is in the context of Galaxy tool ``requirement`` s instead of CWL ``SoftwareRequirement`` s, but the concepts map fairly directly.
246
+
Unfortunately, this documentation is in the context of Galaxy tool
247
+
``requirement`` s instead of CWL ``SoftwareRequirement`` s, but the concepts map fairly directly.
206
248
207
249
cwltool is distributed with an example of such seqtk tool and sample corresponding
208
250
job. It could executed from the cwltool root using a dependency resolvers
Technical outline of how cwltool works internally, for maintainers.
367
453
368
-
#. Use CWL `load_tool()` to load document.
454
+
#. Use CWL ``load_tool()`` to load document.
369
455
370
456
#. Fetches the document from file or URL
371
457
#. Applies preprocessing (syntax/identifier expansion and normalization)
372
458
#. Validates the document based on cwlVersion
373
459
#. If necessary, updates the document to latest spec
374
-
#. Constructs a Process object using `make_tool()` callback. This yields a
460
+
#. Constructs a Process object using ``make_tool()``` callback. This yields a
375
461
CommandLineTool, Workflow, or ExpressionTool. For workflows, this
376
462
recursively constructs each workflow step.
377
463
#. To construct custom types for CommandLineTool, Workflow, or
378
-
ExpressionTool, provide a custom `make_tool()`
464
+
ExpressionTool, provide a custom ``make_tool()``
379
465
380
-
#. Iterate on the `job()` method of the Process object to get back runnable jobs.
466
+
#. Iterate on the ``job()`` method of the Process object to get back runnable jobs.
381
467
382
-
#. `job()` is a generator method (uses the Python iterator protocol)
383
-
#. Each time the `job()` method is invoked in an iteration, it returns one
384
-
of: a runnable item (an object with a `run()` method), `None` (indicating
468
+
#. ``job()`` is a generator method (uses the Python iterator protocol)
469
+
#. Each time the ``job()`` method is invoked in an iteration, it returns one
470
+
of: a runnable item (an object with a ``run()`` method), ``None`` (indicating
385
471
there is currently no work ready to run) or end of iteration (indicating
386
472
the process is complete.)
387
-
#. Invoke the runnable item by calling `run()`. This runs the tool and gets output.
473
+
#. Invoke the runnable item by calling ``run()``. This runs the tool and gets output.
388
474
#. Output of a process is reported by an output callback.
389
-
#. `job()` may be iterated over multiple times. It will yield all the work
475
+
#. ``job()`` may be iterated over multiple times. It will yield all the work
390
476
that is currently ready to run and then yield None.
391
477
392
-
#. "Workflow" objects create a corresponding "WorkflowJob" and "WorkflowJobStep" objects to hold the workflow state for the duration of the job invocation.
478
+
#. ``Workflow`` objects create a corresponding ``WorkflowJob`` and ``WorkflowJobStep`` objects to hold the workflow state for the duration of the job invocation.
393
479
394
480
#. The WorkflowJob iterates over each WorkflowJobStep and determines if the
395
481
inputs the step are ready.
396
482
#. When a step is ready, it constructs an input object for that step and
397
-
iterates on the `job()` method of the workflow job step.
483
+
iterates on the ``job()`` method of the workflow job step.
398
484
#. Each runnable item is yielded back up to top level run loop
399
485
#. When a step job completes and receives an output callback, the
400
486
job outputs are assigned to the output of the workflow step.
401
487
#. When all steps are complete, the intermediate files are moved to a final
402
488
workflow output, intermediate directories are deleted, and the output
403
489
callback for the workflow is called.
404
490
405
-
#. "CommandLineTool" job() objects yield a single runnable object.
491
+
#. ``CommandLineTool`` job() objects yield a single runnable object.
406
492
407
-
#. The CommandLineTool `job()` method calls `makeJobRunner()` to create a
408
-
`CommandLineJob` object
493
+
#. The CommandLineTool ``job()`` method calls ``makeJobRunner()`` to create a
494
+
``CommandLineJob`` object
409
495
#. The job method configures the CommandLineJob object by setting public
410
496
attributes
411
497
#. The job method iterates over file and directories inputs to the
@@ -416,7 +502,7 @@ Technical outline of how cwltool works internally, for maintainers.
416
502
#. Files are staged to targets paths using either Docker volume binds (when
417
503
using containers) or symlinks (if not). This staging step enables files
418
504
to be logically rearranged or renamed independent of their source layout.
419
-
#. The run() method of CommandLineJob executes the command line tool or
505
+
#. The ``run()`` method of CommandLineJob executes the command line tool or
420
506
Docker container, waits for it to complete, collects output, and makes
0 commit comments