You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pretty painful breaking change. I see in #6106 that it was discussed to wait until namespace packages was the default (python/mypy#9636), but that latter PR seems a bit stalled.
At my work we have libraries float their deps to catch issues before they hit applications; since we're not pinning I can't complain about the breakage. However, the fact that there isn't a release of mypy with namespace packages as the default makes this pretty painful, as we're now looking to have to add the namespace_packages configuration to all those repos. protobuf is also a library that by its nature tends to get used widely across a company's repos.
Can we please consider reverting #6106 (merged just 18 hours ago) until there is a new mypy release with namespace packages as the default and an accompanying blog post? For example, the recent switch to decoupled stubs was also a bit painful but having the great docs/blog post made it much smoother. python/mypy#9636 (comment) has some other really great suggestions like improving the error message. @nipunn1313@JelleZijlstra@hauntsaninja
This is definitely a breaking change IMO. I regularly update minor versions and this is totally unexpected. A minor version update shouldn't make me add flags and change other flags and so on.
Here's what happened:
The minor version update broke our pipeline in an MR. I had to enable namespace_packages but then it started to include some other files that were excluded before because of the follow_imports thing. Then I spent the whole day to try to figure out these things and finally fixed it by enabling namespace_packages and changing follow_imports to "silent".
The documentation doesn't state that even if I excluded some folders it can be included by a follow_imports functionality (or I couldn't find anything about this).
Clearly, --namespace-packages as a default (python/mypy#9636) is very important.
Furthermore, I believe #6106 would require a major version bump, not a minor one - to avoid breaking from underneath people.
Thanks everyone for jumping on the reports so quickly.
Activity
hauntsaninja commentedon Mar 21, 2022
I believe this should be fixed with
--namespace-packages(ornamespace_packages = True). This will be the default for mypy soon.ziima commentedon Mar 21, 2022
@hauntsaninja That applies to
types-protobufitself or to its usage?ziima commentedon Mar 21, 2022
Found it.
works fine. That's probably the issue.
heroesm commentedon Mar 21, 2022
Reproduce in Python3.7 and types-protobuf==3.19.14
But after downgrade types-protobuf==3.19.13 the issue disappears.
Run mypy with
--namespace-packagesalso worksaneeshusa commentedon Mar 21, 2022
This is a pretty painful breaking change. I see in #6106 that it was discussed to wait until namespace packages was the default (python/mypy#9636), but that latter PR seems a bit stalled.
At my work we have libraries float their deps to catch issues before they hit applications; since we're not pinning I can't complain about the breakage. However, the fact that there isn't a release of mypy with namespace packages as the default makes this pretty painful, as we're now looking to have to add the namespace_packages configuration to all those repos. protobuf is also a library that by its nature tends to get used widely across a company's repos.
Can we please consider reverting #6106 (merged just 18 hours ago) until there is a new mypy release with namespace packages as the default and an accompanying blog post? For example, the recent switch to decoupled stubs was also a bit painful but having the great docs/blog post made it much smoother. python/mypy#9636 (comment) has some other really great suggestions like improving the error message. @nipunn1313 @JelleZijlstra @hauntsaninja
Cause: python/typeshed#7519
srittau commentedon Mar 21, 2022
Reopening to allow discussion of reverting this.
Run mypy with --namespace-packages due to python/typeshed#7519 (#9256)
gurelkaynak commentedon Mar 21, 2022
This is definitely a breaking change IMO. I regularly update minor versions and this is totally unexpected. A minor version update shouldn't make me add flags and change other flags and so on.
Here's what happened:
The minor version update broke our pipeline in an MR. I had to enable namespace_packages but then it started to include some other files that were excluded before because of the follow_imports thing. Then I spent the whole day to try to figure out these things and finally fixed it by enabling namespace_packages and changing follow_imports to "silent".
The documentation doesn't state that even if I excluded some folders it can be included by a follow_imports functionality (or I couldn't find anything about this).
nipunn1313 commentedon Mar 21, 2022
Hi, author of #6106 here.
@JelleZijlstra / @srittau Please revert it. Thanks.
Clearly,
--namespace-packagesas a default (python/mypy#9636) is very important.Furthermore, I believe #6106 would require a major version bump, not a minor one - to avoid breaking from underneath people.
Thanks everyone for jumping on the reports so quickly.
AlexWaygood commentedon Mar 21, 2022
The breaking change has been reverted.
fix mypy protobuf issue: python/typeshed#7519