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

fix: add mypy checking + 'py.typed' files #149

Merged
merged 9 commits into from
Nov 9, 2021
Merged

fix: add mypy checking + 'py.typed' files #149

merged 9 commits into from
Nov 9, 2021

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Oct 13, 2021

No description provided.

@tseaver tseaver requested a review from a team as a code owner October 13, 2021 20:31
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2021
@tseaver tseaver changed the title ci: add mypy checking fix: add mypy checking + 'py.typed' file Oct 13, 2021
google/cloud/py.typed Outdated Show resolved Hide resolved
@tseaver tseaver requested a review from tswast November 2, 2021 21:01
setup.py Outdated
@@ -39,7 +39,7 @@
package_root = os.path.abspath(os.path.dirname(__file__))

version = {}
with open(os.path.join(package_root, "google/cloud/version.py")) as fp:
with open(os.path.join(package_root, "google/cloud/version/__init__.py")) as fp:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than that, maybe we just back out converting google/cloud/version.py to a package? I don't really see anybody choking on lack of typing when importing the one attribute in that module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backed out in c77b9dc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. It's literally just 1 string, so I'm okay with that.

Our 'release-please' tooling won't find it there, and nobody is likely
to a) import the module,  and then b) choke on its lack of typing.
@tseaver tseaver requested a review from tswast November 8, 2021 17:13
@tseaver tseaver changed the title fix: add mypy checking + 'py.typed' file fix: add mypy checking + 'py.typed' files Nov 8, 2021
@tswast
Copy link
Contributor

tswast commented Nov 9, 2021

Confirmed that it's passing on Kokoro:

nox > Running session mypy
nox > Creating virtual environment (virtualenv) using python3.7 in .nox/mypy
nox > python -m pip install . mypy
nox > python -m pip install types-setuptools types-requests types-mock types-protobuf
nox > mypy google tests
Success: no issues found in 18 source files
nox > Session mypy was successful.

https://source.cloud.google.com/results/invocations/e6d78c2c-70f3-437e-8f48-fc8996976c38/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-cloud-core%2Fpresubmit%2Fpresubmit/log

@tswast tswast merged commit f20ef60 into main Nov 9, 2021
@tswast tswast deleted the add-mypy branch November 9, 2021 15:46
@tswast
Copy link
Contributor

tswast commented Nov 9, 2021

This should go in a minor release, not a patch release. I probably should have marked as feat: rather than fix: when merging.

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.

3 participants