pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.33k stars 638 forks source link

Add apache airflow providers to default module mapping #21207

Closed ndellosa95 closed 3 months ago

ndellosa95 commented 3 months ago

Is your feature request related to a problem? Please describe. I'm sure more than a handful of users are using pants in a repo that contains Airflow code. It would be extremely convenient to add optional airflow packages like this to the default module mapping.

huonw commented 3 months ago

Thanks for identifying this. Would you like to contribute it?

If they follow a consistent mapping from package name to import path, it could likely use the regex-based mappings, e.g. /apache-(.*)/ + first_group_hyphen_to_dot, maybe. https://github.com/pantsbuild/pants/blob/1a65ae2d5bc0543b45bc7d3be1950f399088dd19/src/python/pants/backend/python/dependency_inference/default_module_mapping.py#L86-L103

ndellosa95 commented 3 months ago

Thanks for identifying this. Would you like to contribute it?

If they follow a consistent mapping from package name to import path, it could likely use the regex-based mappings, e.g. /apache-(.*)/ + first_group_hyphen_to_dot, maybe.

https://github.com/pantsbuild/pants/blob/1a65ae2d5bc0543b45bc7d3be1950f399088dd19/src/python/pants/backend/python/dependency_inference/default_module_mapping.py#L86-L103

Opened the PR!