plain-carpet-73994
05/10/2021, 11:43 PMtype_stubs
directory to the root of my repo and added the following to my `pants.toml`:
[source]
root_patterns = ['/', 'type_stubs']
I added a BUILD
file in `type_stubs`:
$ cat type_stubs/BUILD
python_requirement_library(
name = 'numpy_stubs',
requirements=[
'numpy-stubs@ git+<https://github.com/numpy/numpy-stubs@c49d2d6875971a669a166ea93ef998911af283a1>'
]
)
That didn't cause any errors but mypy didn't pick up the stubs for numpy so I also added this to my BUILD
target that uses `numpy`:
python_library(
dependencies=[
'//type_stubs/:numpy_stubs'
]
)
which causes the following error:
Exception message: 1 Exception encountered:
InvalidSpecPath: Address spec has un-normalized path part 'type_stubs/'
Removing the leading //
didn't help either. What am I doing wrong? And, is there an easier way to add stubs for things like numpy?