You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new step to CircleCI builds for type checking by mypy. Changes needed:
Add mypy to requirements.txt. Use whatever the latest version is from this PyPI link.
Add a new step in .circleci/config.yml. This new step should have its name set to be Type checking, and should go just before the existing Lint step. This step should run the command mypy project/wikipron project/tests project/data.
Fix all mypy issues so that the CircleCI builds pass with the mypy step added.
For reference, mypy 0.790 would find the following issues to be fixed across the codebase:
tests/test_data/__init__.py:23: error: The return type of a generator function should be "Generator" or one of its supertypes
tests/test_data/__init__.py:23: error: Argument 1 to "contextmanager" has incompatible type "Callable[[bool, str, str], str]"; expected "Callable[..., Iterator[<nothing>]]"
wikipron/extract/core.py:8: error: Skipping analyzing 'requests_html': found module but no type hints or library stubs
wikipron/extract/default.py:22: error: "Response" has no attribute "html"
wikipron/extract/vie.py:37: error: "Response" has no attribute "html"
wikipron/extract/tha.py:20: error: "Response" has no attribute "html"
wikipron/extract/shn.py:31: error: "Response" has no attribute "html"
wikipron/extract/lat.py:93: error: "Response" has no attribute "html"
wikipron/extract/lat.py:111: error: "Response" has no attribute "html"
wikipron/extract/lat.py:138: error: "Response" has no attribute "html"
wikipron/extract/lat.py:148: error: Incompatible types in assignment (expression has type "None", variable has type "Word")
wikipron/extract/khm.py:23: error: "Response" has no attribute "html"
wikipron/extract/khb.py:35: error: "Response" has no attribute "html"
wikipron/extract/jpn.py:41: error: "Response" has no attribute "html"
wikipron/extract/jpn.py:50: error: "Response" has no attribute "html"
wikipron/extract/cmn.py:27: error: "Response" has no attribute "html"
wikipron/config.py:8: error: Skipping analyzing 'iso639': found module but no type hints or library stubs
wikipron/config.py:9: error: Skipping analyzing 'segments': found module but no type hints or library stubs
wikipron/config.py:124: error: Incompatible return value type (got "Callable[[str], str]", expected "Callable[[Word], Word]")
wikipron/scrape.py:6: error: Skipping analyzing 'requests_html': found module but no type hints or library stubs
wikipron/scrape.py:57: error: Incompatible types in "yield" (actual type "Tuple[Any, str]", expected type "Tuple[Word, Pron]")
tests/test_wikipron/__init__.py:11: error: Argument 1 to "Config" has incompatible type "**Dict[str, str]"; expected "bool"
tests/test_wikipron/__init__.py:19: error: Module has no attribute "ConnectTimeout"
data/src/codes.py:30: error: Skipping analyzing 'iso639': found module but no type hints or library stubs
data/src/codes.py:90: error: Item "None" of "Optional[Match[Any]]" has no attribute "group"
tests/test_wikipron/test_scrape.py:3: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
tests/test_wikipron/test_extract.py:1: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
tests/test_wikipron/test_config.py:4: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
tests/test_wikipron/test_config.py:5: error: Skipping analyzing 'requests_html': found module but no type hints or library stubs
tests/test_wikipron/test_languagecodes.py:3: error: Skipping analyzing 'iso639': found module but no type hints or library stubs
tests/test_wikipron/test_languagecodes.py:4: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
tests/test_data/test_scrape.py:5: error: Skipping analyzing 'pytest': found module but no type hints or library stubs
tests/test_data/test_scrape.py:53: error: Need type annotation for 'dummy_tsv_path'
tests/test_data/test_scrape.py:54: error: Value of type "object" is not indexable
tests/test_data/test_scrape.py:57: error: Argument "config_settings" to "_build_scraping_config" has incompatible type "object"; expected "Dict[str, Any]"
The text was updated successfully, but these errors were encountered:
Add a new step to CircleCI builds for type checking by mypy. Changes needed:
requirements.txt
. Use whatever the latest version is from this PyPI link..circleci/config.yml
. This new step should have its name set to beType checking
, and should go just before the existingLint
step. This step should run the commandmypy project/wikipron project/tests project/data
.CHANGELOG.md
.Guidelines for contributors
For reference, mypy 0.790 would find the following issues to be fixed across the codebase:
The text was updated successfully, but these errors were encountered: