https://pantsbuild.org/ logo
#general
Title
# general
p

plain-carpet-73994

05/10/2021, 11:51 PM
And, even better, is there no way to use stubs like this and not have to make them an explicit dependency? The docs for stubs (https://www.pantsbuild.org/docs/python-typecheck-goal#type-stubs-pyi-files) seem to say I shouldn't need to do that but they're not discovered unless I add them as an explicit dependency.
h

hundreds-father-404

05/11/2021, 12:03 AM
So, to get it working automatically, you would need to set
module_mapping
because pants thinks the module right now is `numpy_stubs`: https://www.pantsbuild.org/docs/python-third-party-dependencies#inline-requirements But then you would have a problem, both the requirements
numpy
and
numpy_stubs
would export the same module name of
numpy
, and it would now be ambiguous when we have imports of
numpy
which you want to use. We do the safe thing of defaulting to neither when there is ambiguity, which is necessary because it would be an error for example if you had
numpy==1.2
and
numpy==1.4
in your project, Pants inferred a dep on both, and we tried installing both which is illegal
6 Views