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

Cannot find third-party libraries used via requirement #57

Closed
psalvaggio-dl opened this issue May 5, 2022 · 3 comments
Closed

Cannot find third-party libraries used via requirement #57

psalvaggio-dl opened this issue May 5, 2022 · 3 comments

Comments

@psalvaggio-dl
Copy link

psalvaggio-dl commented May 5, 2022

I am trying to stand up a monorepo that runs mypy as part of the build phase. I have been installing third-party libraries via pip_parse and requirement in rules_python. However, when I tried out this integration, I get:

error: Cannot find implementation or library stub for module named "numpy"

for all of the third-party dependencies that I depend on via requirement. This seems like the most basic use case, so I figure I must be doing something wrong, but I am not seeing anything in the README about third party imports. Is there a way to make this integration aware of my requirements-based imports?

Thanks,
Phil

@thundergolfer
Copy link
Collaborator

thundergolfer commented May 6, 2022

In practice, if the Typeshed doesn't ship with the stubs, we just resort to ignoring the third-party package using mypy.ini config. This obviously cuts out a large amount of the type-checking mypy could do, but there hasn't been a lot of interest/investment in the mypy_stubs rule.

That said, I thought I heard that recent versions of typeshed do ship numpy stubs.

@psalvaggio-dl
Copy link
Author

OK, I looked into typeshed and I don’t see numpy or any of the other libraries I was using in there. I will try to make a standalone example with some of the libraries in there tomorrow and see if that works. I’m new to Python so I went for mypy because it seems to be the most common and the only one with Bazel integration, but perhaps pytype might be a better solution for my team if we’re going to be using libraries that mypy cannot handle.

@alexeagle
Copy link
Collaborator

Duplicate of #39 - I'm working on it right now.

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

3 participants