[med-svn] [Git][med-team/cwltool][upstream] New upstream version 3.1.20221109155812

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Fri Nov 18 13:09:55 GMT 2022



Michael R. Crusoe pushed to branch upstream at Debian Med / cwltool


Commits:
0e4efdec by Michael R. Crusoe at 2022-11-17T15:13:31+01:00
New upstream version 3.1.20221109155812
- - - - -


17 changed files:

- PKG-INFO
- cwltool.egg-info/PKG-INFO
- cwltool/docker.py
- cwltool/executors.py
- cwltool/main.py
- cwltool/process.py
- cwltool/utils.py
- mypy-requirements.txt
- mypy-stubs/rdflib/namespace/__init__.pyi
- setup.cfg
- setup.py
- test-requirements.txt
- tests/test_make_template.py
- tests/test_udocker.py
- tests/util.py
- tests/wf/cat-tool.cwl
- tox.ini


Changes:

=====================================
PKG-INFO
=====================================
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cwltool
-Version: 3.1.20221008225030
+Version: 3.1.20221109155812
 Summary: Common workflow language reference implementation
 Home-page: https://github.com/common-workflow-language/cwltool
 Author: Common workflow language working group


=====================================
cwltool.egg-info/PKG-INFO
=====================================
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: cwltool
-Version: 3.1.20221008225030
+Version: 3.1.20221109155812
 Summary: Common workflow language reference implementation
 Home-page: https://github.com/common-workflow-language/cwltool
 Author: Common workflow language working group


=====================================
cwltool/docker.py
=====================================
@@ -334,10 +334,11 @@ class DockerCommandLineJob(ContainerCommandLineJob):
         any_path_okay = self.builder.get_requirement("DockerRequirement")[1] or False
         user_space_docker_cmd = runtimeContext.user_space_docker_cmd
         if user_space_docker_cmd:
-            if "udocker" in user_space_docker_cmd and not runtimeContext.debug:
-                runtime = [user_space_docker_cmd, "--quiet", "run"]
-                # udocker 1.1.1 will output diagnostic messages to stdout
-                # without this
+            if "udocker" in user_space_docker_cmd:
+                if runtimeContext.debug:
+                    runtime = [user_space_docker_cmd, "run", "--nobanner"]
+                else:
+                    runtime = [user_space_docker_cmd, "--quiet", "run", "--nobanner"]
             else:
                 runtime = [user_space_docker_cmd, "run"]
         elif runtimeContext.podman:


=====================================
cwltool/executors.py
=====================================
@@ -228,7 +228,7 @@ class SingleJobExecutor(JobExecutor):
             for job in jobiter:
                 if job is not None:
                     if runtime_context.builder is not None and hasattr(job, "builder"):
-                        job.builder = runtime_context.builder  # type: ignore
+                        job.builder = runtime_context.builder
                     if job.outdir is not None:
                         self.output_dirs.add(job.outdir)
                     if runtime_context.research_obj is not None:


=====================================
cwltool/main.py
=====================================
@@ -195,13 +195,15 @@ def generate_example_input(
                 else:
                     comment = "optional"
         else:
-            example = CommentedSeq()
-            for index, entry in enumerate(inptype):
+            example, comment = generate_example_input(inptype[0], default)
+            type_names = []
+            for entry in inptype:
                 value, e_comment = generate_example_input(entry, default)
-                example.append(value)
-                example.yaml_add_eol_comment(e_comment, index)
+                if e_comment:
+                    type_names.append(e_comment)
+            comment = "one of " + ", ".join(type_names)
             if optional:
-                comment = "optional"
+                comment = f"{comment} (optional)"
     elif isinstance(inptype, Mapping) and "type" in inptype:
         if inptype["type"] == "array":
             first_item = cast(MutableSequence[CWLObjectType], inptype["items"])[0]
@@ -1322,7 +1324,11 @@ def main(
                     runtime_context=runtimeContext,
                 )
             except SystemExit as err:
-                return err.code
+                if isinstance(err.code, int):
+                    return err.code
+                else:
+                    _logger.debug("Non-integer SystemExit: %s", err.code)
+                    return 1
 
             del args.workflow
             del args.job_order


=====================================
cwltool/process.py
=====================================
@@ -32,6 +32,7 @@ from typing import (
 )
 
 from cwl_utils import expression
+from mypy_extensions import mypyc_attr
 from pkg_resources import resource_stream
 from rdflib import Graph
 from ruamel.yaml.comments import CommentedMap, CommentedSeq
@@ -535,6 +536,7 @@ def eval_resource(
 FILE_COUNT_WARNING = 5000
 
 
+ at mypyc_attr(allow_interpreted_subclasses=True)
 class Process(HasReqsHints, metaclass=abc.ABCMeta):
     def __init__(
         self, toolpath_object: CommentedMap, loadingContext: LoadingContext


=====================================
cwltool/utils.py
=====================================
@@ -39,7 +39,7 @@ import pkg_resources
 import requests
 from cachecontrol import CacheControl
 from cachecontrol.caches import FileCache
-from mypy_extensions import TypedDict
+from mypy_extensions import TypedDict, mypyc_attr
 from schema_salad.exceptions import ValidationException
 from schema_salad.ref_resolver import Loader
 from typing_extensions import TYPE_CHECKING, Deque
@@ -502,6 +502,7 @@ def create_tmp_dir(tmpdir_prefix: str) -> str:
     return tempfile.mkdtemp(prefix=tmp_prefix, dir=tmp_dir)
 
 
+ at mypyc_attr(allow_interpreted_subclasses=True)
 class HasReqsHints:
     """Base class for get_requirement()."""
 


=====================================
mypy-requirements.txt
=====================================
@@ -1,4 +1,4 @@
-mypy==0.982
+mypy==0.990
 ruamel.yaml>=0.16.0,<0.17.22
 schema-salad>=8.2.20211104054942,<9
 cwl-utils >=0.19


=====================================
mypy-stubs/rdflib/namespace/__init__.pyi
=====================================
@@ -33,7 +33,7 @@ __all__ = [
 
 class Namespace(str):
     @property
-    def title(self) -> URIRef: ...
+    def title(self) -> URIRef: ...  # type: ignore[override]
     def term(self, name: Any) -> URIRef: ...
     def __getitem__(self, key: Any) -> URIRef: ...
     def __getattr__(self, name: str) -> URIRef: ...


=====================================
setup.cfg
=====================================
@@ -18,6 +18,6 @@ line_length = 88
 ignore-words-list = ORE,ore,RO,ro
 
 [egg_info]
-tag_build = .20221008225030
+tag_build = .20221109155812
 tag_date = 0
 


=====================================
setup.py
=====================================
@@ -130,7 +130,7 @@ setup(
     setup_requires=PYTEST_RUNNER,
     test_suite="tests",
     tests_require=[
-        "pytest >= 6.2, < 7.2",
+        "pytest >= 6.2, < 7.3",
         "mock >= 2.0.0",
         "pytest-mock >= 1.10.0",
         "pytest-httpserver",


=====================================
test-requirements.txt
=====================================
@@ -1,4 +1,4 @@
-pytest >= 6.2, < 7.2
+pytest >= 6.2, < 7.3
 pytest-xdist
 pytest-httpserver
 mock >= 2.0.0


=====================================
tests/test_make_template.py
=====================================
@@ -8,3 +8,21 @@ from cwltool import main
 def test_anonymous_record() -> None:
     inputs = cmap([{"type": "record", "fields": []}])
     assert main.generate_example_input(inputs, None) == ({}, "Anonymous record type.")
+
+
+def test_union() -> None:
+    """Test for --make-template for a union type."""
+    inputs = cmap(["string", "string[]"])
+    assert main.generate_example_input(inputs, None) == (
+        "a_string",
+        'one of type "string", type "string[]"',
+    )
+
+
+def test_optional_union() -> None:
+    """Test for --make-template for an optional union type."""
+    inputs = cmap(["null", "string", "string[]"])
+    assert main.generate_example_input(inputs, None) == (
+        "a_string",
+        'one of type "string", type "string[]" (optional)',
+    )


=====================================
tests/test_udocker.py
=====================================
@@ -21,7 +21,7 @@ def udocker(tmp_path_factory: TempPathFactory) -> str:
     docker_install_dir = str(tmp_path_factory.mktemp("udocker"))
     with working_directory(docker_install_dir):
 
-        url = "https://github.com/indigo-dc/udocker/releases/download/v1.3.1/udocker-1.3.1.tar.gz"
+        url = "https://github.com/indigo-dc/udocker/releases/download/1.3.5/udocker-1.3.5.tar.gz"
         install_cmds = [
             ["curl", "-L", url, "-o", "./udocker-tarball.tgz"],
             ["tar", "xzvf", "udocker-tarball.tgz"],
@@ -89,3 +89,19 @@ def test_udocker_should_display_memory_usage(udocker: str, tmp_path: Path) -> No
 
     assert "completed success" in stderr, stderr
     assert "Max memory" in stderr, stderr
+
+
+ at pytest.mark.skipif(not LINUX, reason="LINUX only")
+def test_udocker_nobanner(udocker: str, tmp_path: Path) -> None:
+    """Avoid the banner when running udocker."""
+    with working_directory(tmp_path):
+        error_code, stdout, stderr = get_main_output(
+            [
+                "--user-space-docker-cmd=" + udocker,
+                get_data("tests/wf/cat-tool.cwl"),
+                get_data("tests/wf/wc-job.json"),
+            ]
+        )
+
+    assert "completed success" in stderr, stderr
+    assert "sha1$327fc7aedf4f6b69a42a7c8b808dc5a7aff61376" in stdout, stdout


=====================================
tests/util.py
=====================================
@@ -4,6 +4,7 @@ import json
 import os
 import shutil
 import subprocess
+import sys
 from pathlib import Path
 from typing import Dict, Generator, List, Mapping, Optional, Tuple, Union
 
@@ -107,7 +108,10 @@ def get_main_output(
     try:
         rc = main(argsl=args, stdout=stdout, stderr=stderr)
     except SystemExit as e:
-        rc = e.code
+        if isinstance(e.code, int):
+            rc = e.code
+        else:
+            rc = sys.maxsize
     return (
         rc,
         stdout.getvalue(),


=====================================
tests/wf/cat-tool.cwl
=====================================
@@ -5,7 +5,7 @@ cwlVersion: v1.0
 
 hints:
   DockerRequirement:
-    dockerPull: docker.io/bash:4.4`
+    dockerPull: docker.io/bash:4.4
 
 inputs:
   file1: File


=====================================
tox.ini
=====================================
@@ -4,9 +4,9 @@ envlist =
   py3{6,7,8,9,10,11}-unit
   py3{6,7,8,9,10,11}-bandit
   py3{7,8,9,10,11}-mypy
-  py310-lintreadme
-  py310-shellcheck
-  py310-pydocstyle
+  py311-lintreadme
+  py311-shellcheck
+  py311-pydocstyle
 
 skip_missing_interpreters = True
 
@@ -32,9 +32,9 @@ description =
   py3{6,7,8,9,10,11}-lint: Lint the Python code
   py3{6,7,8,9,10,11}-bandit: Search for common security issues
   py3{7,8,9,10,11}-mypy: Check for type safety
-  py310-pydocstyle: docstring style checker
-  py310-shellcheck: syntax check for shell scripts
-  py310-lintreadme: Lint the README.rst→.md conversion
+  py311-pydocstyle: docstring style checker
+  py311-shellcheck: syntax check for shell scripts
+  py311-lintreadme: Lint the README.rst→.md conversion
 
 passenv =
   CI
@@ -51,19 +51,18 @@ deps =
   py3{6,7,8,9,10,11}-bandit: bandit
   py3{6,7,8,9,10,11}-bandit: importlib_metadata != 4.8.0
   py3{7,8,9,10,11}-mypy: -rmypy-requirements.txt
-  py310-pydocstyle: pydocstyle
-  py310-pydocstyle: diff-cover
-  py310-lintreadme: twine
-  py310-lintreadme: wheel
-  py310-lintreadme: readme_renderer[md]
+  py311-pydocstyle: pydocstyle
+  py311-pydocstyle: diff-cover
+  py311-lintreadme: twine
+  py311-lintreadme: build
+  py311-lintreadme: readme_renderer[md]
 
 setenv =
   py3{6,7,8,9,10,11}-unit: LC_ALL = C.UTF-8
 
 commands_pre =
   py3{6,7,8,9,10,11}-unit: python -m pip install -U pip setuptools wheel
-  py310-lintreadme: python setup.py sdist --dist-dir {distdir}
-  py310-lintreadme: python setup.py bdist_wheel --dist-dir {distdir}
+  py311-lintreadme: python -m build --outdir {distdir}
 
 commands =
   py3{6,7,8,9,10,11}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
@@ -71,9 +70,9 @@ commands =
   py3{6,7,8,9,10,11}-lint: make flake8 format-check codespell
   py3{7,8,9,10,11}-mypy: make mypy mypyc PYTEST_EXTRA={posargs}
   py37-mypy: make mypy_3.6
-  py310-shellcheck: make shellcheck
-  py310-pydocstyle: make diff_pydocstyle_report
-  py310-lintreadme: twine check {distdir}/*
+  py311-shellcheck: make shellcheck
+  py311-pydocstyle: make diff_pydocstyle_report
+  py311-lintreadme: twine check {distdir}/*
 
 skip_install =
   py3{6,7,8,9,10,11}-{bandit,lint,mypy,shellcheck,pydocstyle,lintreadme}: true



View it on GitLab: https://salsa.debian.org/med-team/cwltool/-/commit/0e4efdec8a61cc25ca2aa013b4a0fd9a2c4b7ced

-- 
View it on GitLab: https://salsa.debian.org/med-team/cwltool/-/commit/0e4efdec8a61cc25ca2aa013b4a0fd9a2c4b7ced
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221118/3011434a/attachment-0001.htm>


More information about the debian-med-commit mailing list