and a probably-simple question - ```11:11:33.65 [W...
# general
c
and a probably-simple question -
Copy code
11:11:33.65 [WARN] Pants cannot infer owners for the following imports in the target <..>/stepfn.py:

  * mypy_boto3_stepfunctions.client.SFNClient (line: 7)
I’m using type stubs mapping here, which makes mypy happy but still emits the above warning - but I can’t also use
module_mapping
- how should I avoid that warning? Everything works at runtime, but I’d rather not go and comment each import line if there’s a better way 🙂
Copy code
type_stubs_module_mapping={
        "boto3-stubs": ["boto3"],
    },
e
I googled the module name (mypy_boto3_stepfunctions) and landed here but you don't mention it: https://pypi.org/project/mypy-boto3-stepfunctions/
I'm ignorant of this space, but ... maybe relevant?
c
it’s such a strange project in terms of naming, I’ll re-walk through from the start and try and figure out if I’m missing an obvious thing 🙂
e
Are you using the extra they document?
The page I linked explains using
boto3-stubs[stepfunctions]
for mypy setup.
c
from poetry’s pyproject.toml -
boto3-stubs = {extras = ["secretsmanager", "stepfunctions", "s3"], version = "*"}
e
Ok, and how do you integrate Poetry with pants? Do you
poetry export
a lockfile you configure with Pants or do you just use
poetry_requirements
with no lockfile?
I think this may be another instance of https://pantsbuild.slack.com/archives/C046T6T9U/p1674594297840689?thread_ts=1674592256.471189&amp;cid=C046T6T9U although in a different area (dep inference here, parametrized resolves there). That thread has not settled with a filed issue or further research yet.
r
So for stepfunctions, it should be
Copy code
"boto3-stubs": ["mypy_boto3_stepfunctions"]
c
I’m pretty close to dropping poetry - so I’m using a
poetry_requirements()
source, but a pants lockfile
r
Copy code
poetry_requirements(
    module_mapping={
        "boto3-stubs": ["mypy_boto3_stepfunctions"]  
    },
)
c
I’m sure I moved away from module_mappings to declaring them as type stub module mappings for a reason, but I can’t remember that issue - and going back to module mappings does pass typecheck and tests so maybe I just shouldn’t have changed that in the first place 😅