Vision: python_type_check CI is broken

Created on 11 Oct 2020  路  6Comments  路  Source: pytorch/vision

This looks like an upstream change that broke CI, see https://app.circleci.com/pipelines/github/pytorch/vision/4305/workflows/9ae30f70-6fa0-419f-966b-8db2e249a12b/jobs/254769 for an example

The error we get is

torchvision/datasets/mnist.py:446: error:
Incompatible
return
value
type
(got
"GzipFile",
expected
"IO[Any]")

[return-value]
            return gzip.open(path, 'rb')
                   ^
Found 1 error in 1 file (checked 97 source files)

cc @seemethere @pmeier

ci datasets

All 6 comments

I'm on it.

This is caused by mypy==0.790 released two days ago. It includes python/typeshed@846d922df238d307a99347f74d91ccb362f876ad which amongst others makes the return types of the gzip module more precise.

@pmeier so does this mean that using an older mypy will give type checking errors now?

It shouldn't, but I'm not sure. I'll check and get back to you.

Just checked with mypy 0.780 on the master -> no issues

$ mypy --config-file mypy.ini
Success: no issues found in 97 source files
$ pip list | grep mypy
mypy                   0.780
$ git log -1
commit 610c9d2a063bf0695d4f1c3cc396f0c1f2c3a4af (HEAD -> master, origin/master)
Author: Adeel Hassan <[email protected]>
Date:   Mon Oct 12 13:53:17 2020 +0500

    remove hard coded value (#2793)

awesome, thanks for checking!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iacolippo picture iacolippo  路  4Comments

alpha-gradient picture alpha-gradient  路  3Comments

a-maci picture a-maci  路  3Comments

carlocab picture carlocab  路  3Comments

Abolfazl-Mehranian picture Abolfazl-Mehranian  路  3Comments