brash-baker-91190
10/31/2022, 2:40 PM[pytest].extra_requirements list, and another is for a type that is included in [mypy].extra_type_stubs, whose import is gated behind an if TYPE_CHECKING guard in the test file. This worked without issue in 2.13; is this a bug, or a legitimate new change in behavior? If the latter, what would be the recommended way to fix this? Thanks.sparse-lifeguard-95737
10/31/2022, 2:43 PMsparse-lifeguard-95737
10/31/2022, 2:43 PMif TYPE_CHECKING then you can add a comment on the import line to explicitly disable dependency inference - I think the warning messages you’re seeing should include the commentsparse-lifeguard-95737
10/31/2022, 2:43 PMextra_type_stubs into your main requirements, and mark it as a type modulebrash-baker-91190
10/31/2022, 2:44 PMsparse-lifeguard-95737
10/31/2022, 2:45 PMpython_requirements target has a type_stubs_module_mapping field: https://www.pantsbuild.org/docs/reference-python_requirements#codetype_stubs_module_mappingcodesparse-lifeguard-95737
10/31/2022, 2:45 PMsparse-lifeguard-95737
10/31/2022, 2:45 PMtypes or stubs is a stubs modulesparse-lifeguard-95737
10/31/2022, 2:50 PMbrash-baker-91190
10/31/2022, 2:51 PMpytest-mock in [pytest].extra_requirements, which is what Pants was complaining about. The documentation for that field suggests it's more for plugins that pytest itself needs, rather than dependencies that the tests actually need.sparse-lifeguard-95737
10/31/2022, 2:52 PMsparse-lifeguard-95737
10/31/2022, 2:52 PMpython-infer subsystem can’t “see” extra-requirements fields in other subsystemsbrash-baker-91190
10/31/2022, 2:52 PMsparse-lifeguard-95737
10/31/2022, 2:53 PMbrash-baker-91190
10/31/2022, 3:00 PMpytest-mock dependency into my main requirements file also appears to work.