Skip to content

Commit 2f5ddf4

Browse files
authored
Merge pull request #523 from common-workflow-language/fix_readme
README: Fix linting and minor errors
2 parents 64d481e + 1678fe1 commit 2f5ddf4

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

README.rst

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
==================================================================
2-
Common workflow language tool description reference implementation
2+
Common Workflow Language tool description reference implementation
33
==================================================================
44

5-
CWL Conformance test: |Build Status|
6-
7-
Travis: |Unix Build Status|
5+
CWL conformance tests: |Build Status| Travis CI: |Unix Build Status|
86

97
.. |Unix Build Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/master.svg?label=unix%20build
108
:target: https://travis-ci.org/common-workflow-language/cwltool
119

1210
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
1412
files as well as provide other tools related to working with CWL.
1513

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}``
1715

18-
The reference implementation consists of two packages. The "cwltool" package
16+
The reference implementation consists of two packages. The ``cwltool`` package
1917
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.
2119

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
2422
default CWL interpreter installed on a host.
2523

2624
Install
@@ -64,9 +62,15 @@ Running tests locally
6462

6563
- Running basic tests ``(/tests)``:
6664

67-
.. code:: bash
65+
We use `tox <https://github.com/common-workflow-language/cwltool/tree/master/tox.ini>`_
66+
to run various tests in all supported Python environments.
67+
You can run the test suite by simply running the following in the terminal:
68+
``pip install tox; tox``
6869

69-
python setup.py test
70+
List of all environment can be seen using:
71+
``tox --listenvs``
72+
and running a specfic test env using:
73+
``tox -e <env name>``
7074

7175
- Running the entire suite of CWL conformance tests:
7276

@@ -137,13 +141,17 @@ For this example, grab the test.json (and input file) from https://github.com/Ca
137141
Import as a module
138142
------------------
139143

140-
Add::
144+
Add
145+
146+
.. code:: python
141147
142148
import cwltool
143149
144150
to your script.
145151

146-
The easiest way to use cwltool to run a tool or workflow from Python is to use a Factory::
152+
The easiest way to use cwltool to run a tool or workflow from Python is to use a Factory
153+
154+
.. code:: python
147155
148156
import cwltool.factory
149157
fac = cwltool.factory.Factory()
@@ -202,7 +210,8 @@ for the plugin above, this is ``type`` and defines the plugin type. This paramet
202210
is required for all plugins. The available plugins and the parameters
203211
available for each are documented (incompletely) `here
204212
<https://docs.galaxyproject.org/en/latest/admin/dependency_resolvers.html>`__.
205-
Unfortunately, this documentation is in the context of Galaxy tool ``requirement`` s instead of CWL ``SoftwareRequirement`` s, but the concepts map fairly directly.
213+
Unfortunately, this documentation is in the context of Galaxy tool
214+
``requirement`` s instead of CWL ``SoftwareRequirement`` s, but the concepts map fairly directly.
206215

207216
cwltool is distributed with an example of such seqtk tool and sample corresponding
208217
job. It could executed from the cwltool root using a dependency resolvers
@@ -360,52 +369,52 @@ at the following links:
360369
- `Specifications - Implementation <https://github.com/galaxyproject/galaxy/commit/81d71d2e740ee07754785306e4448f8425f890bc>`__
361370
- `Initial cwltool Integration Pull Request <https://github.com/common-workflow-language/cwltool/pull/214>`__
362371

363-
Cwltool control flow
364-
--------------------
372+
CWL Tool Control Flow
373+
---------------------
365374

366375
Technical outline of how cwltool works internally, for maintainers.
367376

368-
#. Use CWL `load_tool()` to load document.
377+
#. Use CWL ``load_tool()`` to load document.
369378

370379
#. Fetches the document from file or URL
371380
#. Applies preprocessing (syntax/identifier expansion and normalization)
372381
#. Validates the document based on cwlVersion
373382
#. If necessary, updates the document to latest spec
374-
#. Constructs a Process object using `make_tool()` callback. This yields a
383+
#. Constructs a Process object using ``make_tool()``` callback. This yields a
375384
CommandLineTool, Workflow, or ExpressionTool. For workflows, this
376385
recursively constructs each workflow step.
377386
#. To construct custom types for CommandLineTool, Workflow, or
378-
ExpressionTool, provide a custom `make_tool()`
387+
ExpressionTool, provide a custom ``make_tool()``
379388

380-
#. Iterate on the `job()` method of the Process object to get back runnable jobs.
389+
#. Iterate on the ``job()`` method of the Process object to get back runnable jobs.
381390

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
391+
#. ``job()`` is a generator method (uses the Python iterator protocol)
392+
#. Each time the ``job()`` method is invoked in an iteration, it returns one
393+
of: a runnable item (an object with a ``run()`` method), ``None`` (indicating
385394
there is currently no work ready to run) or end of iteration (indicating
386395
the process is complete.)
387-
#. Invoke the runnable item by calling `run()`. This runs the tool and gets output.
396+
#. Invoke the runnable item by calling ``run()``. This runs the tool and gets output.
388397
#. Output of a process is reported by an output callback.
389-
#. `job()` may be iterated over multiple times. It will yield all the work
398+
#. ``job()`` may be iterated over multiple times. It will yield all the work
390399
that is currently ready to run and then yield None.
391400

392-
#. "Workflow" objects create a corresponding "WorkflowJob" and "WorkflowJobStep" objects to hold the workflow state for the duration of the job invocation.
401+
#. ``Workflow`` objects create a corresponding ``WorkflowJob`` and ``WorkflowJobStep`` objects to hold the workflow state for the duration of the job invocation.
393402

394403
#. The WorkflowJob iterates over each WorkflowJobStep and determines if the
395404
inputs the step are ready.
396405
#. 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.
406+
iterates on the ``job()`` method of the workflow job step.
398407
#. Each runnable item is yielded back up to top level run loop
399408
#. When a step job completes and receives an output callback, the
400409
job outputs are assigned to the output of the workflow step.
401410
#. When all steps are complete, the intermediate files are moved to a final
402411
workflow output, intermediate directories are deleted, and the output
403412
callback for the workflow is called.
404413

405-
#. "CommandLineTool" job() objects yield a single runnable object.
414+
#. ``CommandLineTool`` job() objects yield a single runnable object.
406415

407-
#. The CommandLineTool `job()` method calls `makeJobRunner()` to create a
408-
`CommandLineJob` object
416+
#. The CommandLineTool ``job()`` method calls ``makeJobRunner()`` to create a
417+
``CommandLineJob`` object
409418
#. The job method configures the CommandLineJob object by setting public
410419
attributes
411420
#. The job method iterates over file and directories inputs to the
@@ -416,7 +425,7 @@ Technical outline of how cwltool works internally, for maintainers.
416425
#. Files are staged to targets paths using either Docker volume binds (when
417426
using containers) or symlinks (if not). This staging step enables files
418427
to be logically rearranged or renamed independent of their source layout.
419-
#. The run() method of CommandLineJob executes the command line tool or
428+
#. The ``run()`` method of CommandLineJob executes the command line tool or
420429
Docker container, waits for it to complete, collects output, and makes
421430
the output callback.
422431

0 commit comments

Comments
 (0)