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 a py.typed file for submodule #1019

Closed
crwilcox opened this issue Oct 12, 2021 · 6 comments
Closed

Add a py.typed file for submodule #1019

crwilcox opened this issue Oct 12, 2021 · 6 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@crwilcox
Copy link
Contributor

To be in accordance with PEP 561 we should add a py.typed file to google/cloud/bigquery/py.typed

The file can be empty but does need to be present for some type checkers.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Oct 12, 2021
@tswast
Copy link
Contributor

tswast commented Oct 13, 2021

Please don't until #987 is fixed.

@tswast tswast added status: blocked Resolving the issue is dependent on other work. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Oct 13, 2021
@crwilcox
Copy link
Contributor Author

Do note, you may need to run mypy, pyright, pytype against our samples before merging. It will ensure that we aren't exposing users to failing type checks.

Ideally we would add this to CI as well, to avoid future breakage.

@plamut
Copy link
Contributor

plamut commented Oct 27, 2021

Update - we will adjust the annotations to make mypy happy, but we will only add py.typed to the v3 branch (and ship it in 3.0.0).

Even if type checks break for some people, it will only happen in the next major release, which should not happen automatically, if the BigQuery dependency is pinned to < 3.x (as it should be).

(note to self - besides adding the py.typed file itself, we must also list it setup.py, option package_data, so that it actually gets installed)

@crwilcox
Copy link
Contributor Author

https://github.com/googleapis/python-bigquery/blob/main/setup.cfg has a pytype section. Is that tied in to packaging? I am unsure.

@plamut plamut self-assigned this Nov 11, 2021
@plamut plamut added semver: major Hint for users that this is an API breaking change. and removed status: blocked Resolving the issue is dependent on other work. labels Nov 11, 2021
@plamut
Copy link
Contributor

plamut commented Nov 11, 2021

Mypy is happy now, unblocking.

We will only add py.typed to the v3 branch, though, as discussed offline.

@plamut
Copy link
Contributor

plamut commented Nov 12, 2021

Closed in #1058 (merged into the v3 branch).

@plamut plamut closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. semver: major Hint for users that this is an API breaking change. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants