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

pytype is failing for standard pkgutil.extend_path usage #186

Closed
tseaver opened this issue May 13, 2021 · 2 comments
Closed

pytype is failing for standard pkgutil.extend_path usage #186

tseaver opened this issue May 13, 2021 · 2 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: process A process-related concern. May include testing, release, or the like.

Comments

@tseaver
Copy link
Contributor

tseaver commented May 13, 2021

From this Kokoro failure (there are lots):

nox > Running session pytype
nox > Creating virtual environment (virtualenv) using python3.6 in .nox/pytype
nox > python -m pip install . grpcio >= 1.8.2 grpcio-gcp >= 0.2.2 pytype >= 2019.3.21
nox > pytype
Computing dependencies
Analyzing 37 sources with 0 local dependencies
ninja: Entering directory `.pytype'
[1/37] check google.api_core.gapic_v1.routing_header
[2/37] check google.api_core.datetime_helpers
[3/37] check google.api_core.exceptions
[4/37] check google.api_core.general_helpers
[5/37] check google.api_core.timeout
[6/37] check google.api_core.retry
[7/37] check google.api_core.retry_async
[8/37] check google.api_core.version
[9/37] check google.api_core.gapic_v1.config
[10/37] check google.api_core.gapic_v1.config_async
[11/37] check google.api_core.grpc_helpers
[12/37] check google.api_core.grpc_helpers_async
[13/37] check google.api_core.client_info
[14/37] check google.api_core.gapic_v1.client_info
[15/37] check google.api_core.gapic_v1.method
[16/37] check google.api_core.gapic_v1.method_async
[17/37] check google.api_core.gapic_v1.__init__
[18/37] check google.api_core.protobuf_helpers
[19/37] check google.api_core.operations_v1.operations_client_config
[20/37] check google.api_core.page_iterator
[21/37] check google.api_core.operations_v1.operations_client
[22/37] check google.api_core.page_iterator_async
[23/37] check google.api_core.operations_v1.operations_async_client
[24/37] check google.api_core.operations_v1.__init__
[25/37] check google.api_core.future.base
[26/37] check google.api_core.future.async_future
[27/37] check google.api_core.operation_async
[28/37] check google.api_core.future._helpers
[29/37] check google.api_core.iam
[30/37] check google.api_core.future.polling
[31/37] check google.api_core.operation
[32/37] check google.__init__
FAILED: /tmpfs/src/github/python-api-core/.pytype/pyi/google/__init__.pyi
/tmpfs/src/github/python-api-core/.nox/pytype/bin/python -m pytype.single --disable pyi-error --imports_info /tmpfs/src/github/python-api-core/.pytype/imports/google.__init__.imports --module-name google.__init__ -V 3.6 -o /tmpfs/src/github/python-api-core/.pytype/pyi/google/__init__.pyi --analyze-annotated --nofail --quick /tmpfs/src/github/python-api-core/google/__init__.py
File "/tmpfs/src/github/python-api-core/google/__init__.py", line 24, in <module>: Function pkgutil.extend_path was called with the wrong arguments [wrong-arg-types]
         Expected: (path: List[str], ...)
  Actually passed: (path: Iterable[str], ...)

For more details, see https://google.github.io/pytype/errors.html#wrong-arg-types
ninja: build stopped: subcommand failed.
Leaving directory '.pytype'
nox > Command pytype  failed with exit code 1
nox > Session pytype failed.

I suspect we should upgrade to a newer version of pytype -- the current release is more than two years newer than the one we are using, and e.g. supports Python 3.9.

@tseaver tseaver added type: process A process-related concern. May include testing, release, or the like. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels May 13, 2021
@tseaver tseaver self-assigned this May 13, 2021
@tseaver
Copy link
Contributor Author

tseaver commented May 13, 2021

I was able to reproduce the error locally after removing the .pytype/ cache, when running with pytype 2021.05.11. and 2021.05.06. Earlier versions (2021.04.26 and 2021.05.04) did not fail. Reported as google/pytype#918

@busunkim96, @crwilcox Should we pin pytype <= 2021.05.04 to work around this issue?

@tseaver
Copy link
Contributor Author

tseaver commented Jun 9, 2021

I cannot reproduce this on current master (2768346) against the current release of pytype (2021.5.25).

@tseaver tseaver closed this as completed Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 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.

1 participant