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

Mypy Errors with new version of mypy #2046

Closed
gucifer opened this issue Jun 9, 2021 · 2 comments · Fixed by #2050
Closed

Mypy Errors with new version of mypy #2046

gucifer opened this issue Jun 9, 2021 · 2 comments · Fixed by #2050

Comments

@gucifer
Copy link
Contributor

gucifer commented Jun 9, 2021

🐛 Bug description

With the new version of mypy, ignite/handlers/checkpoint.py and ignite/utils.py has some errors related to typing.

ignite/utils.py:161: error: unused "type: ignore" comment
        existing = name is None or name in logging.root.manager.loggerDict...
        ^
ignite/handlers/checkpoint.py:9: error: unused "type: ignore" comment
    from tempfile import _TemporaryFileWrapper  # type: ignore[attr-define...
    ^
ignite/handlers/checkpoint.py:695: error: Incompatible types in assignment
(expression has type "None", variable has type "_TemporaryFileWrapper") 
[assignment]
                tmp = None  # type: _TemporaryFileWrapper
                      ^
ignite/handlers/checkpoint.py:697: error: Incompatible types in assignment
(expression has type "IO[bytes]", variable has type "_TemporaryFileWrapper") 
[assignment]
                    tmp = tempfile.NamedTemporaryFile(delete=False, dir=se...
                          ^
Found 4 errors in 2 files (checked 98 source files)

Environment

  • Ignite Version (e.g., 0.3.0): Current master branch
  • OS (e.g., Linux): Linux
  • How you installed Ignite (conda, pip, source): source
  • Python version: 3.8.6
  • Any other relevant information:
    mypy version: mypy-0.901-cp38-cp38-manylinux2010_x86_64
@gucifer
Copy link
Contributor Author

gucifer commented Jun 9, 2021

cc: @trsvchn and @ydcjeff

@sahilg06
Copy link
Contributor

sahilg06 commented Jun 10, 2021

Hi @gucifer, I am new to PyTorch Ignite, I would like to have a go at this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants