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

'mypy_stubs' rule not working. Reproduction within. #36

Open
thundergolfer opened this issue Feb 9, 2021 · 2 comments
Open

'mypy_stubs' rule not working. Reproduction within. #36

thundergolfer opened this issue Feb 9, 2021 · 2 comments

Comments

@thundergolfer
Copy link
Collaborator

thundergolfer commented Feb 9, 2021

Reproduction in https://github.com/thundergolfer/bazel-python-mypy-protobuf/tree/master/bazel_mypy_integration_issue_36

I'm getting:

bazel test //... --test_output=all --sandbox_debug
INFO: Analyzed 5 targets (0 packages loaded, 0 targets configured).
INFO: Found 4 targets and 1 test target...
FAIL: //tools/thing:mypy_test_foo (see /private/var/tmp/_bazel_jonathon/fafac219b6b0ff0ed453a7d553f169f1/execroot/bazel_mypy_integration_issue_36/bazel-out/darwin-fastbuild/testlogs/tools/thing/mypy_test_foo/test.log)
INFO: From Testing //tools/thing:mypy_test_foo:
==================== Test output for //tools/thing:mypy_test_foo:
tools/thing/proto/bling_api_pb2.pyi:26: error: syntax error in type comment  [syntax]

In the internal code that hit this issue, the error is:

Use --sandbox_debug to see verbose messages from the sandbox
tools/foo/proto/foo_api_pb2.py: error: Duplicate module named 'tools.foo.proto.foo_api_pb2' (also at 'tools/foo/proto/foo_api_pb2.pyi')
Found 1 error in 1 file (errors prevented further checking)
INFO: Elapsed time: 2.294s, Critical Path: 1.98s
INFO: 5 processes: 5 internal.
FAILED: Build did NOT complete successfully

In that internal error, the integration should be letting the .pyi file 'win', as is stated in the documentation: https://mypy.readthedocs.io/en/stable/stubs.html#:~:text=Mypy%20uses%20stub%20files%20stored,to%20type%20check%20your%20code.

@thundergolfer thundergolfer changed the title 'mypy_stubs' rule not working 'mypy_stubs' rule not working. Reproduction within. Feb 9, 2021
@thundergolfer
Copy link
Collaborator Author

cc @charlesverdad

@juanique
Copy link

Is there a workaround for this? this prevents me from using mypy build-time aspect checks because it breaks as soon as I introduce a protobuf + python target with this error.

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

No branches or pull requests

2 participants