Skip to content

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

Closed

Description

@tseaver

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

Activity

  1. added
    type: process
    on May 22, 2019
  2. tseaver commented on May 22, 2019

    @tseaver
    ContributorAuthor

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

  3. rchen152 commented on May 22, 2019

    @rchen152
    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).

  4. tseaver commented on May 22, 2019

    @tseaver
    ContributorAuthor

    @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
  5. rchen152 commented on May 22, 2019

    @rchen152
    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

Metadata

Metadata

Assignees

Labels

api: coretestingtype: process

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions