Skip to content

Commit a9e9a85

Browse files
committed
update README
1 parent 065b294 commit a9e9a85

File tree

3 files changed

+86
-72
lines changed

3 files changed

+86
-72
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ test: $(PYSOURCES)
146146

147147
## testcov : run the ${MODULE} test suite and collect coverage
148148
testcov: $(PYSOURCES)
149-
python setup.py test --addopts "--cov" ${PYTEST_EXTRA}
149+
pytest --cov ${PYTEST_EXTRA}
150150

151151
sloccount.sc: $(PYSOURCES) Makefile
152152
sloccount --duplicates --wide --details $^ > $@

README.rst

Lines changed: 82 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,111 @@
1-
# cwl-utils
2-
3-
A collection of scripts to demonstrate the use of the new Python classes for
4-
loading and parsing [CWL v1.0 ](https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_0.py),
5-
[CWL v1.1](https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_1.py),
6-
and [CWL v1.2](https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_2.py)
1+
|Linux Build Status| |Code coverage| |Documentation Status|
2+
3+
.. |Linux Build Status| image:: https://github.com/common-workflow-language/cwl-utils/actions/workflows/ci-tests.yml/badge.svg?branch=main
4+
:target: https://github.com/common-workflow-language/cwl-utils/actions/workflows/ci-tests.yml
5+
.. |Code coverage| image:: https://codecov.io/gh/common-workflow-language/cwl-utils/branch/main/graph/badge.svg
6+
:target: https://codecov.io/gh/common-workflow-language/cwl-utils
7+
.. |Documentation Status| image:: https://readthedocs.org/projects/cwl-utils/badge/?version=latest
8+
:target: https://cwl-utils.readthedocs.io/en/latest/?badge=latest
9+
:alt: Documentation Status
10+
11+
cwl-utils
12+
---------
13+
14+
A collection of scripts to demonstrate the use of the new Python classes
15+
for loading and parsing `CWL
16+
v1.0 <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_0.py>`__,
17+
`CWL
18+
v1.1 <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_1.py>`__,
19+
and `CWL
20+
v1.2 <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_2.py>`__
721
documents.
822

9-
## Install
10-
1123
Requires Python 3.6+
1224

13-
``` bash
14-
virtualenv -p python3.6 venv3.6 # Python 3.7, 3.8, or 3.9 would also work
15-
source venv3.6/bin/activate
16-
pip install cwl-utils
17-
```
18-
or install the latest development version of `cwl-utils`
25+
Installation
26+
------------
27+
28+
::
29+
30+
pip3 install cwl-utils
1931

20-
``` bash
21-
git clone https://github.com/common-workflow-language/cwl-utils.git
22-
cd cwl-utils
23-
virtualenv -p python3.6 venv3.6 # Python 3.7, 3.8, or 3.9 would also work
24-
source venv3.6/bin/activate
25-
pip install .
26-
```
27-
(If you want to edit the sources from the development version, then run
28-
`pip install -e .`)
32+
To install from source::
2933

30-
## Usage
34+
git clone https://github.com/common-workflow-language/cwl-utils.git
35+
cd cwl-utils
36+
pip3 install .
3137

32-
### Pull the all referenced software container images
38+
Usage
39+
-----
3340

34-
`docker_extract.py` is useful to cache or pre-pull all software container images
35-
referenced in a CWL CommandLineTool or CWL Workflow (including all referenced
36-
CommandLineTools and sub-Workflows and so on).
41+
Pull the all referenced software container images
42+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3743

38-
The default behaviour is to use the Docker engine to download and save the software
39-
container images in Docker format.
44+
``docker_extract.py`` is useful to cache or pre-pull all software
45+
container images referenced in a CWL CommandLineTool or CWL Workflow
46+
(including all referenced CommandLineTools and sub-Workflows and so on).
4047

41-
```bash
42-
docker_extract.py DIRECTORY path_to_my_workflow.cwl
43-
```
48+
The default behaviour is to use the Docker engine to download and save
49+
the software container images in Docker format.
4450

45-
Or you can use the Singularity software container engine to download and save the
46-
software container images and convert them to the Singularity format at the same
47-
time.
51+
.. code:: bash
4852
49-
```bash
50-
docker_extract.py --singularity DIRECTORY path_to_my_workflow.cwl
51-
```
53+
docker_extract.py DIRECTORY path_to_my_workflow.cwl
5254
53-
### Using the CWL Parsers
55+
Or you can use the Singularity software container engine to download and
56+
save the software container images and convert them to the Singularity
57+
format at the same time.
5458

55-
[//]: # "Please keep the below synchronized with load_cwl_by_path.py"
56-
```python
57-
from pathlib import Path
58-
from ruamel import yaml
59-
import sys
59+
.. code:: bash
6060
61-
from cwl_utils.parser import load_document_by_path, save
61+
docker_extract.py --singularity DIRECTORY path_to_my_workflow.cwl
6262
63-
# File Input - This is the only thing you will need to adjust or take in as an input to your function:
64-
cwl_file = Path("testdata/md5sum.cwl") # or a plain string works as well
63+
Using the CWL Parsers
64+
~~~~~~~~~~~~~~~~~~~~~
6565

66-
# Import CWL Object
67-
cwl_obj = load_document_by_path(cwl_file)
66+
.. code:: python
6867
69-
# View CWL Object
70-
print("List of object attributes:\n{}".format("\n".join(map(str, dir(cwl_obj)))))
68+
from pathlib import Path
69+
from ruamel import yaml
70+
import sys
7171
72-
# Export CWL Object into a built-in typed object
73-
saved_obj = save(cwl_obj)
74-
print(f"Export of the loaded CWL object: {saved_obj}.")
75-
```
72+
from cwl_utils.parser import load_document_by_path, save
7673
77-
## Development
74+
# File Input - This is the only thing you will need to adjust or take in as an input to your function:
75+
cwl_file = Path("testdata/md5sum.cwl") # or a plain string works as well
7876
79-
### Regenerate parsers
77+
# Import CWL Object
78+
cwl_obj = load_document_by_path(cwl_file)
8079
81-
To regenerate install the `schema_salad` package and run:
80+
# View CWL Object
81+
print("List of object attributes:\n{}".format("\n".join(map(str, dir(cwl_obj)))))
8282
83-
`cwl_utils/parser/cwl_v1_0.py` was created via
84-
`schema-salad-tool --codegen python https://github.com/common-workflow-language/common-workflow-language/raw/main/v1.0/CommonWorkflowLanguage.yml`
83+
# Export CWL Object into a built-in typed object
84+
saved_obj = save(cwl_obj)
85+
print(f"Export of the loaded CWL object: {saved_obj}.")
8586
86-
`cwl_utils/parser/cwl_v1_1.py` was created via
87-
`schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.1/raw/main/CommonWorkflowLanguage.yml`
87+
Development
88+
-----------
8889

89-
`cwl_utils/parser/cwl_v1_2.py` was created via
90-
`schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.2/raw/1.2.1_proposed/CommonWorkflowLanguage.yml`
90+
Regenerate parsers
91+
~~~~~~~~~~~~~~~~~~
9192

93+
To regenerate install the ``schema_salad`` package and run:
9294

93-
### Release
95+
``cwl_utils/parser/cwl_v1_0.py`` was created via
96+
``schema-salad-tool --codegen python https://github.com/common-workflow-language/common-workflow-language/raw/main/v1.0/CommonWorkflowLanguage.yml``
9497

95-
To release CWLUtils, bump the version in `cwl_utils/__meta__.py`, and tag that
96-
commit with the new version. The [gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish)
98+
``cwl_utils/parser/cwl_v1_1.py`` was created via
99+
``schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.1/raw/main/CommonWorkflowLanguage.yml``
100+
101+
``cwl_utils/parser/cwl_v1_2.py`` was created via
102+
``schema-salad-tool --codegen python https://github.com/common-workflow-language/cwl-v1.2/raw/1.2.1_proposed/CommonWorkflowLanguage.yml``
103+
104+
Release
105+
~~~~~~~
106+
107+
To release CWLUtils, bump the version in ``cwl_utils/__meta__.py``, and
108+
tag that commit with the new version. The
109+
`gh-action-pypi-publish <https://github.com/pypa/gh-action-pypi-publish>`__
97110
should release that tag.
111+

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ envlist =
44
py{36,37,38,39,310}-unit,
55
py{36,37,38,39,310}-bandit,
66
py{36,37,38,39,310}-mypy,
7-
py39-lint-readme,
7+
py310-lint-readme,
88
py39-pydocstyle
99

1010
skip_missing_interpreters = True
@@ -27,7 +27,7 @@ description =
2727
py{36,37,38,39,310}-bandit: Search for common security issues
2828
py{36,37,38,39,310}-mypy: Check for type safety
2929
py39-pydocstyle: docstring style checker
30-
py39-lint-readme: Lint the README.rst->.md conversion
30+
py310-lint-readme: Lint the README.rst->.md conversion
3131

3232
passenv =
3333
CI
@@ -68,7 +68,7 @@ deps =
6868
diff-cover
6969
skip_install = true
7070

71-
[testenv:py39-lint-readme]
71+
[testenv:py310-lint-readme]
7272
description = Lint the README.rst->.md conversion
7373
commands =
7474
python setup.py sdist

0 commit comments

Comments
 (0)