Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ jobs:
step: [lintreadme, shellcheck, pydocstyle]

env:
py-semver: 3.9
TOXENV: ${{ format('py39-{0}', matrix.step) }}
py-semver: "3.10"
TOXENV: ${{ format('py310-{0}', matrix.step) }}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -171,7 +171,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10" # quoted, otherwise that turns into the number 3.1

- name: Give the test runner user a name to make provenance happy.
run: sudo usermod -c 'CI Runner' $(whoami)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- cron: '0 10 * * 2'

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
group: codeql-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MODULE=cwltool
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
isort wheel autoflake flake8-bugbear pyupgrade bandit \
-rtest-requirements.txt -rmypy_requirements.txt
-rtest-requirements.txt -rmypy-requirements.txt
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
python-flake8 python-mock shellcheck

Expand Down
2 changes: 1 addition & 1 deletion cwltool.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk add --no-cache git gcc python3-dev libxml2-dev libxslt-dev libc-dev linu
WORKDIR /cwltool
COPY . .

RUN pip install toml -rmypy_requirements.txt "$(grep ruamel requirements.txt)" \
RUN pip install toml -rmypy-requirements.txt "$(grep ruamel requirements.txt)" \
"$(grep schema.salad requirements.txt)"
# schema-salad is needed to be installed (this time as pure Python) for
# cwltool + mypyc
Expand Down
8 changes: 1 addition & 7 deletions cwltool/provenance_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@
WFPROV,
)
from .stdfsaccess import StdFsAccess
from .utils import (
CWLObjectType,
JobsType,
get_listing,
posix_path,
versionstring,
)
from .utils import CWLObjectType, JobsType, get_listing, posix_path, versionstring
from .workflow_job import WorkflowJob

if TYPE_CHECKING:
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions release-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export LC_ALL=C

package=cwltool
module=cwltool
extras="[deps]"

if [ "$GITHUB_ACTIONS" = "true" ]; then
# We are running as a GH Action
Expand All @@ -24,7 +25,7 @@ run_tests() {
"${test_prefix}"bin/py.test "--ignore=${mod_loc}/schemas/" \
--pyargs -x ${module} -n auto --dist=loadfile
}
pipver=20.3 # minimum required version of pip for Python 3.10
pipver=20.3.3 # minimum required version of pip for Python 3.10
setuptoolsver=50.0.0 # required for Python 3.10
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

Expand All @@ -41,8 +42,7 @@ then
rm -f testenv1/lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setuptoolsver} wheel
pip install -rtest-requirements.txt
pip install -e .
pip install -rtest-requirements.txt ".${extras}"
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir testenv1/not-${module}
Expand All @@ -67,7 +67,7 @@ rm -f lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setuptoolsver} wheel
# The following can fail if you haven't pushed your commits to ${repo}
pip install -e "git+${repo}@${HEAD}#egg=${package}"
pip install -e "git+${repo}@${HEAD}#egg=${package}${extras}"
pushd src/${package}
pip install -rtest-requirements.txt
make dist
Expand All @@ -90,12 +90,14 @@ rm -f lib/python-wheels/setuptools* \
&& pip install setuptools==${setuptoolsver} wheel
package_tar=$(find . -name "${package}*tar.gz")
pip install "-r${DIR}/test-requirements.txt"
pip install "${package_tar}"
pip install "${package_tar}${extras}"
mkdir out
tar --extract --directory=out -z -f ${package}*.tar.gz
pushd out/${package}*
make dist
make test
pip install "-r${DIR}/mypy-requirements.txt"
make mypy
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir ../not-${module}
pushd ../not-${module}
Expand Down
13 changes: 9 additions & 4 deletions tests/test_trs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest import mock
from unittest.mock import MagicMock

from cwltool.loghandler import _logger
from cwltool.main import main

from .util import get_data
Expand All @@ -21,8 +22,7 @@ def json(self) -> Any:
return self.json_data


def mocked_requests_head(*args: Any) -> MockResponse1:

def mocked_requests_head(*args: Any, **kwargs: Any) -> MockResponse1:
return MockResponse1(None, 200)


Expand Down Expand Up @@ -87,14 +87,18 @@ def mocked_requests_get(*args: Any, **kwargs: Any) -> MockResponse2:
200,
)

print("A mocked call to TRS missed, target was %s", args[0])
_logger.debug("A mocked call to TRS missed, target was %s", args[0])
return MockResponse2(None, 404)


@mock.patch("requests.Session.head", side_effect=mocked_requests_head)
@mock.patch("requests.Session.get", side_effect=mocked_requests_get)
def test_tool_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
params = ["--make-template", r"quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4"]
params = [
"--debug",
"--make-template",
r"quay.io/briandoconnor/dockstore-tool-md5sum:1.0.4",
]
return_value = main(params)
mock_head.assert_called()
mock_get.assert_called()
Expand All @@ -105,6 +109,7 @@ def test_tool_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
@mock.patch("requests.Session.get", side_effect=mocked_requests_get)
def test_workflow_trs_template(mock_head: MagicMock, mock_get: MagicMock) -> None:
params = [
"--debug",
"--make-template",
r"#workflow/github.com/dockstore-testing/md5sum-checker:develop",
]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ deps =
py3{6,7,8,9,10}-lint: black
py3{6,7,8,9,10}-bandit: bandit
py3{6,7,8,9,10}-bandit: importlib_metadata != 4.8.0
py3{6,7,8,9,10}-mypy: -rmypy_requirements.txt
py3{6,7,8,9,10}-mypy: -rmypy-requirements.txt
py39-pydocstyle: pydocstyle
py39-pydocstyle: diff-cover
py39-lintreadme: twine
Expand Down