proud-dentist-22844
11/18/2022, 5:32 AM<https://github.com/pantsbuild/pants/compare/main...cognifloyd:pants:py-infer-dep-rules|https://github.com/pantsbuild/pants/compare/main...cognifloyd:pants:py-infer-dep-rules>
proud-dentist-22844
11/18/2022, 5:34 AMproud-dentist-22844
11/18/2022, 5:36 AMproud-dentist-22844
11/18/2022, 5:45 AMcareful-address-89803
11/18/2022, 6:28 AMproud-dentist-22844
11/18/2022, 6:59 AMcurved-television-6568
11/18/2022, 12:33 PMcareful-address-89803
11/20/2022, 7:17 PM_get_imports_info
instead, for a similar result (like you indicated).
I think a different view would be to view the dependency rules as culling the targets which could become Owners. We would then move the logic into the Get(..., PythonModuleOwners)
or somewhere deeper in that. There is already some filtering done in FirstPartyPythonModuleMapping.providers_for_module
based on the resolve. It's a bit different in that it either searches in one resolve or all of them, rather than actually culling the available mappings. This view doesn't readily offer debug information, but could be provided through something similar to the way 3rd party deps have suggestions for other resolves that contain them. I haven't actually dug into this part of the codebase, tho.
A couple edge cases I can see:
• need to discard unambiguous but blocked owners
• explicit dep on blocked ownerproud-dentist-22844
11/24/2022, 4:44 AMproud-dentist-22844
11/24/2022, 4:44 AMproud-dentist-22844
11/24/2022, 4:50 AMComing at this from a debug point of view, I think there are 2 distinct situations:
1. dep would be ambiguous, but visibility rules disambiguate
2. dep is findable, but visibility rules discard, resulting in UnownedI landed on the first option. My thinking is documented in the PR description. I looked at modifying
Get(..., PythonModuleOwners)
, but that looks like a dangerous path to modify, because that seems like it would be a lot less performant as the request would be a lot more specific (and less reusable). The PythonModuleOwnersRequest
would have to get the relevant details about both sides of the dependency (the dependent and the dependency) to be able to effectively filter the valid owners.
I guess the way to approach implementing your second option, "dep is findable", we would need an additional Get(..., FilteredPythonModuleOwners)
that reuses the existing Get(..., PythonModuleOwners)
rule, but then filters the full set.curved-television-6568
11/24/2022, 4:58 AMcareful-address-89803
11/24/2022, 5:39 PM