diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccaa84c531..541e8889ef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,6 +52,7 @@ below: - Mel Hall (Met Office, UK) - Ronnie Dutta (Met Office, UK) - Roddy Sharp (Met Office UK) + - Mark Dawson (Met Office UK) (All contributors are identifiable with email addresses in the version control diff --git a/metomi/rosie/tests/test_suite_id.py b/metomi/rosie/tests/test_suite_id.py index fecb44e0b6..99679658a6 100644 --- a/metomi/rosie/tests/test_suite_id.py +++ b/metomi/rosie/tests/test_suite_id.py @@ -15,12 +15,14 @@ # along with Rose. If not, see . import json -from pathlib import Path -from typing import Optional +from typing import TYPE_CHECKING, Optional import pytest from metomi.rosie.suite_id import SuiteId +if TYPE_CHECKING: + from pathlib import Path + @pytest.mark.parametrize( 'vcs_info, expected', @@ -42,7 +44,7 @@ ] ) def test_parse_cylc_vc_file( - vcs_info: dict, expected: Optional[str], tmp_path: Path + vcs_info: dict, expected: Optional[str], tmp_path: 'Path' ): vcs_file = tmp_path / 'gimli.json' vcs_file.write_text(json.dumps(vcs_info)) diff --git a/mypy.ini b/mypy.ini index 4a40e7977f..e3f8165724 100644 --- a/mypy.ini +++ b/mypy.ini @@ -13,3 +13,7 @@ allow_redefinition = True strict_equality = True show_error_codes = True + +# Suppress the following messages: +# By default the bodies of untyped functions are not checked, consider using --check-untyped-defs +disable_error_code = annotation-unchecked \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 9d80ec942a..af186f98d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -81,6 +81,7 @@ rosa = tests = aiosmtpd flake8>=4.0.0 + flake8-type-checking; python_version > "3.7" mypy>=0.800 pytest types-aiofiles