You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_mapping and/or gazelle_python_manifest and/or plugin itself.
🚀 feature request
Relevant Rules
modules_mappinggazelle_python_manifestgazelleDescription
Gazelle plugin uses
gazelle_python.yaml(gazelle:python_manifest_file_name) to derivedepsfor 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 patchinggazelle_python.yamlbut 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:
modules_mappingand/orgazelle_python_manifestand/or plugin itself.Describe the solution you'd like
SanitizeDistributioninpythonconfig.Config#FindThirdPartyDependency, take the value as is.SanitizeDistributioninmodules_mapping, orgazelle_python_manifest. I'd saymodules_mappingis best but please advice.