diff --git a/Makefile b/Makefile index f01090aeb..7ede5f2d3 100644 --- a/Makefile +++ b/Makefile @@ -183,12 +183,6 @@ list-author-emails: mypy3: mypy mypy: $(PYSOURCES) - if ! test -f $(shell python -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \ - then \ - rm -Rf mypy-stubs/ruamel/yaml ; \ - ln -s $(shell python -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \ - mypy-stubs/ruamel/ ; \ - fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^ mypyc: $(PYSOURCES) diff --git a/cwltool/context.py b/cwltool/context.py index cbfa24102..e76c7dad6 100644 --- a/cwltool/context.py +++ b/cwltool/context.py @@ -43,7 +43,7 @@ class ContextBase: - """Shared kwargs based initilizer for :py:class:`RuntimeContext` and :py:class:`LoadingContext`.""" + """Shared kwargs based initializer for :py:class:`RuntimeContext` and :py:class:`LoadingContext`.""" def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None: """Initialize.""" diff --git a/cwltool/job.py b/cwltool/job.py index 55c8cfc87..d1950154b 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -190,7 +190,7 @@ def is_streamable(file: str) -> bool: return False for inp in self.joborder.values(): if isinstance(inp, dict) and inp.get("location", None) == file: - return inp.get("streamable", False) + return cast(bool, inp.get("streamable", False)) return False for knownfile in self.pathmapper.files(): diff --git a/lint-requirements.txt b/lint-requirements.txt index f2ce66286..c2a2cee82 100644 --- a/lint-requirements.txt +++ b/lint-requirements.txt @@ -1,3 +1,3 @@ flake8-bugbear<23.10 -black~=23.9 +black~=22.0 codespell diff --git a/mypy-requirements.txt b/mypy-requirements.txt index 2b71dc144..a5275dbec 100644 --- a/mypy-requirements.txt +++ b/mypy-requirements.txt @@ -1,4 +1,4 @@ -mypy==1.3.0 # also update pyproject.toml +mypy==1.6.0 # also update pyproject.toml ruamel.yaml>=0.16.0,<0.18 cwl-utils>=0.22 types-requests diff --git a/mypy.ini b/mypy.ini index bac992869..b99f97b82 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,6 +5,7 @@ show_column_numbers = true show_error_codes = true pretty = true warn_unreachable = True +new_type_inference = True [mypy-galaxy.tool_util.*] ignore_missing_imports = True diff --git a/pyproject.toml b/pyproject.toml index 70b985255..90c1bbc4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [build-system] requires = [ "setuptools>=45", - "mypy==1.3.0", # also update mypy-requirements.txt + "mypy==1.6.0", # also update mypy-requirements.txt "types-requests", "types-psutil", "importlib_resources>=1.4", # equivalent to Python 3.9 "ruamel.yaml>=0.16.0,<0.18", "schema-salad>=8.4.20230426093816,<9", + "packaging<22", "cwl-utils>=0.19", "toml", "argcomplete>=1.12.0", diff --git a/requirements.txt b/requirements.txt index d92936b34..997c68122 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ requests>=2.6.1 -ruamel.yaml>=0.15.0,<0.18 -ruamel.yaml>=0.16;python_version>='3.10' +ruamel.yaml>=0.16.0,<0.18 rdflib>=4.2.2,<7.1 shellescape>=3.4.1,<3.9 schema-salad>=8.4.20230426093816,<9 @@ -12,4 +11,5 @@ coloredlogs pydot>=1.4.1 argcomplete>=1.12.0 pyparsing!=3.0.2 # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319 +packaging<22 cwl-utils>=0.22 diff --git a/setup.py b/setup.py index a86b1a4ad..c32b773ec 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ "cwltool/workflow.py", ] - from mypyc.build import mypycify # type: ignore[import] + from mypyc.build import mypycify # type: ignore[import-untyped] opt_level = os.getenv("MYPYC_OPT_LEVEL", "3") ext_modules = mypycify(mypyc_targets, opt_level=opt_level) @@ -112,8 +112,7 @@ "setuptools", "requests >= 2.6.1", # >= 2.6.1 to workaround # https://github.com/ionrock/cachecontrol/issues/137 - "ruamel.yaml >= 0.15, < 0.18", - "ruamel.yaml >= 0.16.0;python_version>='3.10'", + "ruamel.yaml >= 0.16, < 0.18", "rdflib >= 4.2.2, < 7.1.0", "shellescape >= 3.4.1, < 3.9", "schema-salad >= 8.4.20230426093816, < 9", @@ -125,6 +124,7 @@ "pydot >= 1.4.1", "argcomplete", "pyparsing != 3.0.2", # breaks --print-dot (pydot) https://github.com/pyparsing/pyparsing/issues/319 + "packaging<22", "cwl-utils >= 0.22", ], extras_require={ diff --git a/tests/test_toolargparse.py b/tests/test_toolargparse.py index ad6626385..756c373e8 100644 --- a/tests/test_toolargparse.py +++ b/tests/test_toolargparse.py @@ -180,7 +180,7 @@ def test_dont_require_inputs(tmp_path: Path) -> None: def test_argparser_with_doc() -> None: - """The `desription` field is set if `doc` field is provided.""" + """The `description` field is set if `doc` field is provided.""" loadingContext = LoadingContext() tool = load_tool(get_data("tests/with_doc.cwl"), loadingContext) p = argparse.ArgumentParser() @@ -189,7 +189,7 @@ def test_argparser_with_doc() -> None: def test_argparser_without_doc() -> None: - """The `desription` field is None if `doc` field is not provided.""" + """The `description` field is None if `doc` field is not provided.""" loadingContext = LoadingContext() tool = load_tool(get_data("tests/without_doc.cwl"), loadingContext) p = argparse.ArgumentParser() diff --git a/tests/wf/schemadef-bug-1473.cwl b/tests/wf/schemadef-bug-1473.cwl index b586be1dd..ad87ae08e 100644 --- a/tests/wf/schemadef-bug-1473.cwl +++ b/tests/wf/schemadef-bug-1473.cwl @@ -449,7 +449,7 @@ "name": "#settings-by-samples__1.0.0.yaml/settings-by-samples/samples" }, { - "label": "settings by override cylces", + "label": "settings by override cycles", "doc": "Additional bcl convert settings\n", "type": [ "null",