Skip to content

Commit

Permalink
Flake8 type checking (#2730)
Browse files Browse the repository at this point in the history
  • Loading branch information
markgrahamdawson authored Dec 4, 2023
1 parent 12368c7 commit 56dc066
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- end-shortlog -->

(All contributors are identifiable with email addresses in the version control
Expand Down
8 changes: 5 additions & 3 deletions metomi/rosie/tests/test_suite_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
# along with Rose. If not, see <http://www.gnu.org/licenses/>.

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',
Expand All @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ rosa =
tests =
aiosmtpd
flake8>=4.0.0
flake8-type-checking; python_version > "3.7"
mypy>=0.800
pytest
types-aiofiles
Expand Down

0 comments on commit 56dc066

Please sign in to comment.