Skip to content

Commit a230044

Browse files
authored
Merge branch 'main' into input_annotations
2 parents 70d184f + 6a10aa5 commit a230044

File tree

1,475 files changed

+9614
-244556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,475 files changed

+9614
-244556
lines changed

.github/workflows/ci-tests.yml

Lines changed: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@ jobs:
1919
tox:
2020
name: CI tests via Tox
2121

22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-20.04 # 22.04 doesn't support Python 3.6
2323

2424
strategy:
2525
matrix:
2626
py-ver-major: [3]
27-
py-ver-minor: [6, 7, 8, 9, 10]
27+
py-ver-minor: [6, 7, 8, 9, 10, 11]
2828
step: [lint, unit, bandit, mypy]
29+
exclude:
30+
- py-ver-major: 3
31+
py-ver-minor: 6
32+
step: mypy
2933

3034
env:
3135
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
@@ -47,7 +51,7 @@ jobs:
4751
run: sudo usermod -c 'CI Runner' $(whoami)
4852

4953
- name: Set up Python
50-
uses: actions/setup-python@v3
54+
uses: actions/setup-python@v4
5155
with:
5256
python-version: ${{ env.py-semver }}
5357
cache: pip
@@ -75,6 +79,7 @@ jobs:
7579
uses: codecov/codecov-action@v3
7680
with:
7781
fail_ci_if_error: true
82+
token: ${{ secrets.CODECOV_TOKEN }}
7883

7984
tox-style:
8085
name: CI linters via Tox
@@ -86,16 +91,16 @@ jobs:
8691
step: [lintreadme, shellcheck, pydocstyle]
8792

8893
env:
89-
py-semver: "3.10"
90-
TOXENV: ${{ format('py310-{0}', matrix.step) }}
94+
py-semver: "3.11"
95+
TOXENV: ${{ format('py311-{0}', matrix.step) }}
9196

9297
steps:
9398
- uses: actions/checkout@v3
9499
with:
95100
fetch-depth: 0
96101

97102
- name: Set up Python
98-
uses: actions/setup-python@v3
103+
uses: actions/setup-python@v4
99104
with:
100105
python-version: ${{ env.py-semver }}
101106
cache: pip
@@ -121,17 +126,27 @@ jobs:
121126
matrix:
122127
cwl-version: [v1.0, v1.1, v1.2]
123128
container: [docker, singularity, podman]
129+
extras: [""]
130+
include:
131+
- cwl-version: v1.2
132+
container: docker
133+
extras: "--fast-parser"
124134

125135
steps:
126136
- uses: actions/checkout@v3
127137

128138
- name: Set up Singularity
139+
if: ${{ matrix.container == 'singularity' }}
129140
uses: eWaterCycle/setup-singularity@v7
130141
with:
131142
singularity-version: ${{ env.singularity_version }}
132143

144+
- name: Set up Podman
145+
if: ${{ matrix.container == 'podman' }}
146+
run: sudo rm -f /usr/bin/docker ; sudo apt-get install -y podman
147+
133148
- name: Set up Python
134-
uses: actions/setup-python@v3
149+
uses: actions/setup-python@v4
135150
with:
136151
python-version: 3.9
137152
cache: pip
@@ -141,12 +156,13 @@ jobs:
141156
version: ${{ matrix.cwl-version }}
142157
container: ${{ matrix.container }}
143158
spec_branch: main
159+
CWLTOOL_OPTIONS: ${{ matrix.extras }}
144160
run: ./conformance-test.sh
145161

146162
release_test:
147163
name: cwltool release test
148164

149-
runs-on: ubuntu-20.04
165+
runs-on: ubuntu-22.04
150166

151167
steps:
152168
- uses: actions/checkout@v3
@@ -157,9 +173,9 @@ jobs:
157173
singularity-version: ${{ env.singularity_version }}
158174

159175
- name: Set up Python
160-
uses: actions/setup-python@v3
176+
uses: actions/setup-python@v4
161177
with:
162-
python-version: "3.10" # quoted, otherwise that turns into the number 3.1
178+
python-version: 3.11
163179
cache: pip
164180
cache-dependency-path: |
165181
requirements.txt
@@ -177,3 +193,51 @@ jobs:
177193
env:
178194
RELEASE_SKIP: head
179195
run: ./release-test.sh
196+
197+
build_test_container:
198+
runs-on: ubuntu-latest
199+
steps:
200+
- uses: actions/checkout@v3
201+
- name: build & test cwltool_module container
202+
run: ./build-cwltool-docker.sh
203+
204+
macos:
205+
name: CI test on macos-latest
206+
runs-on: macos-latest
207+
env:
208+
TOXENV: py310-unit
209+
steps:
210+
- uses: actions/checkout@v3
211+
with:
212+
fetch-depth: 0
213+
- name: Set up Python
214+
uses: actions/setup-python@v4
215+
with:
216+
python-version: 3.11
217+
cache: pip
218+
cache-dependency-path: |
219+
requirements.txt
220+
tox.ini
221+
- name: Upgrade setuptools and install tox
222+
run: |
223+
pip install -U pip setuptools wheel
224+
pip install tox tox-gh-actions
225+
# # docker for mac install is not currently stable
226+
# - name: 'SETUP MacOS: load Homebrew cache'
227+
# uses: actions/cache@v3
228+
# if: runner.os == 'macOS'
229+
# with:
230+
# path: |
231+
# ~/Library/Caches/Homebrew/downloads/*--Docker.dmg
232+
# key: brew-actions-setup-docker-1.0.11
233+
# restore-keys: brew-actions-setup-docker-
234+
# - name: setup docker on macos (default stable version)
235+
# uses: docker-practice/actions-setup-docker@master
236+
- name: Test with tox
237+
run: tox
238+
- name: Upload coverage to Codecov
239+
if: ${{ matrix.step == 'unit' }}
240+
uses: codecov/codecov-action@v3
241+
with:
242+
fail_ci_if_error: true
243+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727

2828
# Initializes the CodeQL tools for scanning.
2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v1
30+
uses: github/codeql-action/init@v2
3131
with:
3232
languages: python
3333

3434
- name: Perform CodeQL Analysis
35-
uses: github/codeql-action/analyze@v1
35+
uses: github/codeql-action/analyze@v2

.github/workflows/quay-publish.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,39 @@ jobs:
1313
id: image_tags
1414
run: |
1515
echo -n ::set-output name=IMAGE_TAGS::${GITHUB_REF#refs/*/}
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
1618
- name: Set up Docker Buildx
17-
uses: docker/setup-buildx-action@v1
19+
uses: docker/setup-buildx-action@v2
20+
- name: Cache Docker layers
21+
uses: actions/cache@v2
22+
with:
23+
path: /tmp/.buildx-cache
24+
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
25+
restore-keys: |
26+
${{ runner.os }}-multi-buildx
1827
- name: Login to Quay.io
19-
uses: docker/login-action@v1
28+
uses: docker/login-action@v2
2029
with:
2130
registry: ${{ secrets.REGISTRY_SERVER }}
2231
username: ${{ secrets.REGISTRY_USERNAME }}
2332
password: ${{ secrets.REGISTRY_PASSWORD }}
2433
- name: Build and publish cwltool_module image to Quay
25-
uses: docker/build-push-action@v2
34+
uses: docker/build-push-action@v3
2635
with:
2736
file: cwltool.Dockerfile
28-
tags: quay.io/commonwl/cwltool_module:${{ steps.image_tags.outputs.IMAGE_TAGS }}
37+
tags: quay.io/commonwl/cwltool_module:${{ steps.image_tags.outputs.IMAGE_TAGS }},quay.io/commonwl/cwltool_module:latest
2938
target: module
39+
platforms: linux/amd64,linux/arm64
3040
push: true
3141
cache-from: type=gha
3242
cache-to: type=gha,mode=max
3343
- name: Build and publish cwltool image to Quay
34-
uses: docker/build-push-action@v2
44+
uses: docker/build-push-action@v3
3545
with:
3646
file: cwltool.Dockerfile
37-
tags: quay.io/commonwl/cwltool:${{ steps.image_tags.outputs.IMAGE_TAGS }}
47+
tags: quay.io/commonwl/cwltool:${{ steps.image_tags.outputs.IMAGE_TAGS }},quay.io/commonwl/cwltool:latest
48+
platforms: linux/amd64,linux/arm64
3849
push: true
3950
cache-from: type=gha
4051
cache-to: type=gha,mode=max

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ venv3/
2828
# pycharm
2929
.idea/
3030

31-
# typshed repo
32-
typeshed/2and3/schema_salad
33-
typeshed/2and3/ruamel/yaml
34-
31+
# local stubs
32+
mypy-stubs/ruamel/yaml
3533

3634
#mypy
3735
.mypy_cache/
@@ -54,3 +52,6 @@ time.txt
5452
value
5553

5654
.python-version
55+
56+
# Folder created when using make
57+
cwltool_deps

CONTRIBUTING.md

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,69 @@
11
Style guide:
2-
- PEP-8
3-
- Python 3.7+ compatible code
2+
- PEP-8 (as implemented by the `black` code formatting tool)
3+
- Python 3.6+ compatible code
44
- PEP-484 type hints
5-
- Vertically align the type hints in function definitions
65

7-
The development is done using ``git``, we encourage you to get familiar with it.
6+
The development is done using `git`, we encourage you to get familiar with it.
87
Here's a rough guide (improvements are welcome!)
98
To get the code and start working on the changes you can start a console and:
10-
- Clone the cwltool: ``git clone https://github.com/common-workflow-language/cwltool.git``
11-
- Switch to cwltool directory: ``cd cwltool``
9+
- Clone the cwltool: `git clone https://github.com/common-workflow-language/cwltool.git`
10+
- Switch to cwltool directory: `cd cwltool`
1211

13-
In order to contribute to the development of ``cwltool``, the source code needs to pass the test before your changes are accepted.
14-
There are a couple ways to test the code with your changes: let `tox` manage installation and test running in virtual environments, or do it manually (preferably in a virtual environment):
15-
- Install ``tox`` preferably using the OS' package manager, otherwise it can be installed with ``pip install --user -U tox``
12+
In order to contribute to the development of `cwltool`, the source code needs to
13+
pass the test before your changes are accepted. There are a couple ways to test
14+
the code with your changes: let `tox` manage installation and test running in
15+
virtual environments, or do it manually (preferably in a virtual environment):
16+
- Install `tox` preferably using the OS' package manager, otherwise it can be
17+
installed with `pip install --user -U tox`
1618
- Make your changes to the code and add tests for new cool things you're adding!
17-
- Run the tests with the command ``tox``, it's recommended to use some parameters as tox will try to run all the checks in all available python interpreters.
18-
- The important tests to run are ``unit tests`` and ``type tests``.
19-
To run these two in Python 3.7, we can tell tox to run only those tests by running: ``tox -e py37-unit,py37-mypy2,py37-mypy3``.
20-
- Run ``tox -l`` to see all available tests and runtimes
19+
- Run the tests with the command `tox`, it's recommended to use some parameters
20+
as tox will try to run all the checks in all available python interpreters.
21+
- The important tests to run are "unit tests" and "type tests".
22+
To run these two in Python 3.7 (for example), we can tell tox to run only those
23+
tests by running: `tox -e py37-mypy`. (the `mypy` tox target also runs the
24+
unit tests; to just run the type checker use `make mypy` as shown below)
25+
- Run `tox -l` to see all available tests and runtimes
2126

2227
For the more traditional workflow:
23-
- Create a virtual environment: ``python3 -m venv cwltool``
24-
- To begin using the virtual environment, it needs to be activated: ``source bin/activate``
25-
- To check if you have the virtual environment set up: ``which python`` and it should point to python executable in your virtualenv
26-
- Install cwltool: ``pip install -e .``
27-
- Check the version which might be different from the version installed in general on any system: ``cwltool --version``
28+
- Create a virtual environment: `python3 -m venv cwltool`
29+
(if you have multiple version of Python installed, then you can replace `python3`
30+
in this command with the version you want to use, `python3.10` for example)
31+
- To begin using the virtual environment, it needs to be activated: `source venv/bin/activate`
32+
- To check if you have the virtual environment set up: `which python`
33+
and it should point to python executable in your virtualenv
34+
- Install the latest versions of `pip` and `wheel` with `pip install --upgrade pip wheel`
35+
- Install cwltool in development mode, along with development tools:
36+
`make install-dep dev`
37+
- Check the `cwltool` version which might be different from the version installed in
38+
general on your system: `cwltool --version`
2839
- Make your changes to the code and add tests for new cool things you're adding!
29-
- Run the unit-tests to see : ``python setup.py test``
30-
- After you're done working on ``cwltool``, you can deactivate the virtual environment: ``deactivate``
40+
- Run the unit-tests to see : `make test`
41+
- After you're done working on `cwltool`, you can deactivate the virtual
42+
environment: `deactivate`
3143

32-
When tests are passing, you can simply commit and create a PR on ``cwltool`` repo
44+
Before you commit your code (or at least before you push to GitHub) it is
45+
recommended to run `make cleanup`
46+
(which is a shortcut for `make sort_imports format flake8 diff_pydocstyle_report`)
47+
to fix common issues and point out any remaining code formatting issues
48+
that cannot be fixed automatically.
49+
50+
When tests are passing, you can create git commits in a new branch and push to
51+
GitHub to make a pull request on `cwltool` repo
52+
53+
Useful `make` commands:
54+
The `make` commands below can help you to install the dependencies, format and test your code
55+
56+
- `make help` to show the list of commands that can be used with the make function
57+
- `make install-dep` will install the dependencies needed by `cwltool`
58+
- `make format` will clean up your code according to the accepted python standard
59+
- `make test` will perform the tests of `cwltool` (can take a while to run all tests)
60+
- `make sort_imports` will clean up and sort your import statements
61+
- `make remove_unused_imports` will remove any unneeded `import` statements
62+
- `make flake8` will catch format issues that `make format` cannot fix automatically
63+
- `make diff_pydocstyle_report` check Python docstring style for changed files only
64+
- `make diff-cover` to run the tests and point out which lines of code that have been
65+
changed as compared to the `main` branch are missing test coverage. This is also calculated
66+
automatically after all the automatic tests run when you open a Pull Request on GitHub;
67+
running it locally can help you confirm that any changes or additions
68+
to the tests are sufficient before pushing to GitHub.
69+
- `make cleanup` is a shortcut for `make sort_imports format flake8 diff_pydocstyle_report`

MANIFEST.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ include MANIFEST.in
33
include LICENSE.txt
44
include *requirements.txt mypy.ini tox.ini
55
include gittaggers.py Makefile cwltool.py
6-
recursive-include typeshed *.pyi
6+
recursive-include mypy-stubs *.pyi *.py
77
include tests/*
8+
include tests/loop/*
89
include tests/tmp1/tmp2/tmp3/.gitkeep
910
include tests/tmp4/alpha/*
1011
include tests/wf/*
@@ -52,11 +53,9 @@ include cwltool/schemas/v1.2/*.yml
5253
include cwltool/schemas/v1.2/*.md
5354
include cwltool/schemas/v1.2/salad/schema_salad/metaschema/*.yml
5455
include cwltool/schemas/v1.2/salad/schema_salad/metaschema/*.md
55-
include cwltool/cwlNodeEngine.js
56-
include cwltool/cwlNodeEngineJSConsole.js
57-
include cwltool/cwlNodeEngineWithContext.js
5856
include cwltool/extensions.yml
5957
include cwltool/extensions-v1.1.yml
58+
include cwltool/extensions-v1.2.yml
6059
include cwltool/jshint/jshint_wrapper.js
6160
include cwltool/jshint/jshint.js
6261
include cwltool/hello.simg

0 commit comments

Comments
 (0)