Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flake8 type checking #2730

Merged
merged 4 commits into from
Dec 4, 2023
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
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 @@ -80,6 +80,7 @@ graph =
rosa =
tests =
flake8>=4.0.0
flake8-type-checking; python_version > "3.7"
mypy>=0.800
pytest
types-aiofiles
Expand Down
Loading