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

Remove google/__init__.pyi #6106

Merged
merged 1 commit into from
Mar 20, 2022
Merged

Conversation

nipunn1313
Copy link
Contributor

Since google is a namespace package, it won't have an init.

Depends on typeshed-internal/stub_uploader#33 - so the stub uploader can handle it

Should wait until
microsoft/pyright@5e38fab gets in. See discussion

May also want to wait until python/mypy#9636 gets in - as it'll be confusing for folks to have to add the --namespace-packages flag to mypy for things to work.

Since google is a namespace package, it won't have an init.
Depends on typeshed-internal/stub_uploader#33
@srittau srittau added the status: deferred Issue or PR deferred until some precondition is fixed label Oct 3, 2021
@JelleZijlstra
Copy link
Member

Waiting for the mypy change might not be a good idea; it's likely going to take a while.

@nipunn1313
Copy link
Contributor Author

I've made some progress with python/mypy#11257 , python/mypy#11259 , python/mypy#11261 .
I'm hoping to get python/mypy#9636 across the finish line.

That being said - this doesn't strictly depend on it, but it will confuse everyone using protobuf stubs - since they'll have to add this --namespace-packages flag for things to continue to work.

Depends on typeshed-internal/stub_uploader#33 - so the stub uploader can handle it
Should wait until microsoft/pyright@5e38fab gets in.

^ both of these have gotten in!

@srittau
Copy link
Collaborator

srittau commented Feb 2, 2022

Is this PR viable now?

@nipunn1313
Copy link
Contributor Author

Ideally python/mypy#9636 gets in first. I think it is ready, though I sense some hesitancy in the thread there.

Otherwise, we'll have to educate a lot of folks to pass --namespace-packages to use this stub.

If we think python/mypy#9636 will have a lot of delay - I can instead look into alternate ways to encourage people to set --namespace-packages manually (perhaps a useful error message in the right place). It feels a little embarrassing to mypy to do so, since the feature has been stable in python itself for so long.

@srittau
Copy link
Collaborator

srittau commented Feb 2, 2022

Ok, lets wait for mypy 0.940, in case python/mypy#9636 goes into it. If it doesn't make 0.940 for some reason, we can merge it here first.

@hmc-cs-mdrissi
Copy link
Contributor

Now that 0.940 has been released can we merge this?

My interest is that the lack of this, means pyright produces a number of errors when google libraries are imported and that google stub information gets lost. At moment I've mostly just followed a practice of type ignore and let several google libraries behave like Any.

@JelleZijlstra
Copy link
Member

I'm OK with merging this.

@hauntsaninja do you think the namespace packages change will make it into mypy soon?

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Mar 20, 2022

Probably 🤷

I'm fine with this being merged whenever, since it's impacting users of other type checkers.

@JelleZijlstra JelleZijlstra merged commit a11a664 into python:master Mar 20, 2022
@AlexWaygood AlexWaygood removed the status: deferred Issue or PR deferred until some precondition is fixed label Mar 20, 2022
@nipunn1313
Copy link
Contributor Author

Hi! Please revert due to #7519 !

JelleZijlstra added a commit that referenced this pull request Mar 21, 2022
AlexWaygood pushed a commit that referenced this pull request Mar 21, 2022
@nipunn1313 nipunn1313 deleted the google_ns_pkg branch October 20, 2022 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants