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

Add type-checking via pytype to api_core. #6116

Merged
merged 3 commits into from
Sep 27, 2018
Merged

Add type-checking via pytype to api_core. #6116

merged 3 commits into from
Sep 27, 2018

Conversation

rchen152
Copy link
Contributor

Type-checks all of api_core outside of tests with pytype.

  • Adds pytype options to setup.cfg so the code can be type-checked with pytype -V{major.minor}.
  • Runs pytype -V3.5 and pytype -V3.6 under nox.
    Manually tested by pip-installing pytype and nox-automation in a Python 3.6 virtualenv.

@theacodes cc-ing you on this PR as you requested

With these changes, pytype can now be run on api_core with the
following steps in a Python 3.5 or 3.6 virtualenv:

$ git clone git@github.com:GoogleCloudPlatform/google-cloud-python.git
$ pip install googleapis-common-protos protobuf google-auth requests \
  setuptools six pytz futures grpcio grpcio-gcp
$ pip install pytype
$ cd google-cloud-python/api_core/
$ pytype -V3.5  # or 3.6
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 26, 2018
@theacodes theacodes added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2018
@kokoro-team kokoro-team removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Sep 27, 2018
api_core/nox.py Outdated Show resolved Hide resolved
@theacodes theacodes added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 27, 2018
@theacodes theacodes merged commit 65d6eba into googleapis:master Sep 27, 2018
@theacodes
Copy link
Contributor

Thank you, @rchen152!

@rchen152 rchen152 deleted the pytype branch September 27, 2018 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants