From ff9c82d304c97894fdfe4b24dad27109c88be401 Mon Sep 17 00:00:00 2001 From: John Kurkowski Date: Tue, 17 Oct 2023 12:55:01 -0700 Subject: [PATCH] Increase typecheck aggression --- pyproject.toml | 5 +---- tests/cli_test.py | 4 ++-- tldextract/suffix_list.py | 2 +- tldextract/tldextract.py | 5 ++++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 70018c2a..f8ca9414 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,10 +63,7 @@ write_to = "tldextract/_version.py" version = {attr = "setuptools_scm.get_version"} [tool.mypy] -check_untyped_defs = true -disallow_incomplete_defs = true -disallow_untyped_calls = true -disallow_untyped_defs = true +strict = true [tool.pytest.ini_options] addopts = "--doctest-modules" diff --git a/tests/cli_test.py b/tests/cli_test.py index 5f967c94..115131ae 100644 --- a/tests/cli_test.py +++ b/tests/cli_test.py @@ -27,7 +27,7 @@ def test_cli_parses_args(monkeypatch: pytest.MonkeyPatch) -> None: def test_cli_posargs( - capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch + capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch ) -> None: """Test CLI with basic, positional args.""" monkeypatch.setattr( @@ -42,7 +42,7 @@ def test_cli_posargs( def test_cli_namedargs( - capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch + capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch ) -> None: """Test CLI with basic, positional args, and that it parses an optional argument (though it doesn't change output).""" monkeypatch.setattr( diff --git a/tldextract/suffix_list.py b/tldextract/suffix_list.py index 2aa65dcc..62427367 100644 --- a/tldextract/suffix_list.py +++ b/tldextract/suffix_list.py @@ -9,7 +9,7 @@ from typing import cast import requests -from requests_file import FileAdapter # type: ignore[import] +from requests_file import FileAdapter # type: ignore[import-untyped] from .cache import DiskCache diff --git a/tldextract/tldextract.py b/tldextract/tldextract.py index d57a9c4b..95a7acd0 100644 --- a/tldextract/tldextract.py +++ b/tldextract/tldextract.py @@ -353,7 +353,10 @@ class Trie: """Trie for storing eTLDs with their labels in reverse-order.""" def __init__( - self, matches: dict | None = None, end: bool = False, is_private: bool = False + self, + matches: dict[str, Trie] | None = None, + end: bool = False, + is_private: bool = False, ) -> None: """TODO.""" self.matches = matches if matches else {}