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

api_core: fix / disable the broken 'pytype' session in 'nox'. #8097

Closed
tseaver opened this issue May 22, 2019 · 4 comments · Fixed by #8106
Closed

api_core: fix / disable the broken 'pytype' session in 'nox'. #8097

tseaver opened this issue May 22, 2019 · 4 comments · Fixed by #8106
Assignees
Labels
api: core testing type: process A process-related concern. May include testing, release, or the like.

Comments

@tseaver
Copy link
Contributor

tseaver commented May 22, 2019

CI is broken for unrelated PRs due to this failure, e.g. see this Kokoro run for PR #7628.

@tseaver tseaver added testing api: core type: process A process-related concern. May include testing, release, or the like. labels May 22, 2019
@tseaver
Copy link
Contributor Author

tseaver commented May 22, 2019

@rchen152 Is this new failure in our 'pytype' session due to a recent release of pytype, e.g. perhaps containing google/pytype#314?

@rchen152
Copy link
Contributor

This looks like more fallout from python/typeshed@e45f443. Typeshed is representing the return value of functools.partial() as a function rather than a class in order to get better type-checking when the returned partial is used. I'll send a PR to silence the failure (should be as simple as adding # pytype: disable=wrong-arg-types at the end of the line that pytype is complaining about).

@tseaver
Copy link
Contributor Author

tseaver commented May 22, 2019

@rchen152 That is an odd choice for Typeshed to make: functools.partial is most definitely a type in both Python 2.7 and 3.7:

$ python2.7
Python 2.7.14 (default, Oct  4 2017, 16:09:27) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.partial
<type 'functools.partial'>
>>> ^D
$ python3.7
Python 3.7.1 (default, Oct 22 2018, 11:31:38) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import functools
>>> functools.partial
<class 'functools.partial'>
>>> ^D

@rchen152
Copy link
Contributor

I didn't author or review that change, but from what I understand, the reasoning was that it caused only a small number of false positives and made type-checking more precise in the vast majority of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core testing type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants