-
-
Notifications
You must be signed in to change notification settings - Fork 677
Description
🚀 feature request
Relevant Rules
modules_mappinggazelle_python_manifestgazelle
Description
Gazelle plugin uses gazelle_python.yaml (gazelle:python_manifest_file_name) to derive deps for py targets. One might expect that a dependency label will be ${manifest.pip_repository}//${manifest.modules_mapping.some.import}, however, Gazelle does extra sanitisation right before using the mapping value here.
Although it is not a big deal when used with rules_python, it makes harder to reuse Gazelle plugin with other python rules, more specifically rules_pycross, which has a different target naming convention, which is aligned with Python normalised names. In this ticket, there is an approach (or hack really) described for patching gazelle_python.yaml but further sanitisation that happens inside the plugin itself makes it impossible to use.
I do understand that compatibility with other rules most likely isn't of highest priority, here are some other reasons:
- It would be slightly less confusing when target name derivation (normalisation / alignment) happens in once place, rather than in
modules_mappingand/orgazelle_python_manifestand/or plugin itself. - Given that there are ongoing efforts to Pull rules_pycross into rules_python #1360, it might be a good improvement going forward.
Describe the solution you'd like
- Do not
SanitizeDistributioninpythonconfig.Config#FindThirdPartyDependency, take the value as is. - Do
SanitizeDistributioninmodules_mapping, orgazelle_python_manifest. I'd saymodules_mappingis best but please advice.