refined-addition-53644
10/07/2022, 2:42 PMextra_requirements
.
My exact case is with mypy. I added some stub for boto3 called boto3-stubs
but the package itself is mypy_boto3_batch
when I need to use the import. e.g.
from mypy_boto3_batch.client import BatchClient
Hence pants is generating warnings about not being able to infer the owner of such import.
This is the relevant section of pants.toml
[mypy]
version = "mypy>=0.971"
extra_requirements.add = [
"pydantic>=1.9.1",
"pandas-stubs>=1.4.4.220919",
"types-requests>=2.28.11",
"boto3-stubs[s3,batch]>=1.24"
]
extra_type_stubs = ["pandas-stubs>=1.4.4.220919", "types-requests>=2.28.11", "boto3-stubs[s3,batch]>=1.24"]
lockfile = "build-support/mypy.lock"
hundreds-father-404
10/07/2022, 2:46 PMrefined-addition-53644
10/07/2022, 2:51 PM# pants: no-infer-dep
as you’ve mentioned in the ticket.refined-addition-53644
10/07/2022, 2:56 PMboto3-stubs
can have multiple extras and based on that it can lead to different import name like mypy_boto3_batch
, mypy_boto3_s3
etchappy-kitchen-89482
10/07/2022, 3:18 PMbumpy-noon-80834
10/07/2022, 9:30 PMpython_requirement(
name = "mypy-boto3-dynamodb",
requirements = ["mypy-boto3-dynamodb"],
type_stub_modules = ["boto3"],
)
So I had no issue when importing it.