You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/14 12:00:57 UTC

[GitHub] [tvm] Mousius opened a new pull request #9284: [Tests] Ensure MyPy type checks pass

Mousius opened a new pull request #9284:
URL: https://github.com/apache/tvm/pull/9284


   There's a few errors that come up when type checking that aren't triggering any failures:
   ```
   Checking MyPy Type defs in the meta schedule package.
   python/tvm/meta_schedule/utils.py:23:1: error: Cannot find implementation or library stub for module named "psutil"
   python/tvm/meta_schedule/utils.py:23:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
   python/tvm/meta_schedule/search_strategy/search_strategy.py: note: In member "__init__" of class "MeasureCandidate":
   python/tvm/meta_schedule/search_strategy/search_strategy.py:59:13: error: Module has no attribute "MeasureCandidate"
   python/tvm/meta_schedule/search_strategy/search_strategy.py: note: In member "initialize_with_tune_context" of class "SearchStrategy":
   python/tvm/meta_schedule/search_strategy/search_strategy.py:83:9: error: Module has no attribute "SearchStrategyInitializeWithTuneContext"
   ```
   
   To rectify this the `types-psutil` package adds type hints for `mypy` and `# type: ignore` stops `mypy` from trying to figure out types of `_ffi_api` resources.
   
   There's also a few places where variable type definitions are repeated even though they're only required once.
   
   Finally, I've ensured `task_mypy.sh` fails the build since it's stable right now, using `set -e`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mikepapadim commented on pull request #9284: [Tests] Ensure MyPy type checks pass

Posted by GitBox <gi...@apache.org>.
mikepapadim commented on pull request #9284:
URL: https://github.com/apache/tvm/pull/9284#issuecomment-943307587


   LGMT, thanks @Mousius 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mikepapadim commented on a change in pull request #9284: [Tests] Ensure MyPy type checks pass

Posted by GitBox <gi...@apache.org>.
mikepapadim commented on a change in pull request #9284:
URL: https://github.com/apache/tvm/pull/9284#discussion_r728926349



##########
File path: python/tvm/meta_schedule/utils.py
##########
@@ -20,7 +20,7 @@
 import shutil
 from typing import Any, Callable, List, Optional, Union
 
-import psutil
+import psutil  # type: ignore

Review comment:
       Is type checking needed for imports?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on pull request #9284: [Tests] Ensure MyPy type checks pass

Posted by GitBox <gi...@apache.org>.
Mousius commented on pull request #9284:
URL: https://github.com/apache/tvm/pull/9284#issuecomment-943299116


   cc @mikepapadim 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] mikepapadim commented on pull request #9284: [Tests] Ensure MyPy type checks pass

Posted by GitBox <gi...@apache.org>.
mikepapadim commented on pull request #9284:
URL: https://github.com/apache/tvm/pull/9284#issuecomment-943308662


   cc @areusch 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org