-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to provide their own dependency to imports mapping #260
Comments
Remember to have a look at other tools that provide a way for users to define their own package -> import mapping, e.g. Pants. |
How Pants handles that:
Pigar allows to link a local mapping database, but it is more a form of a cache than what a user may conveniently provide. |
We may use TOML format for apache-airflow = ["airflow"]
atlassian-python-api = ["atlassian"]
attrs = ["attr", "attrs"] |
I agree that TOML is a good format for this mapping, but I wonder if it has to be a different file than
[tool.fawltydeps.custom_mapping]
apache-airflow = ["airflow"]
atlassian-python-api = ["atlassian"]
attrs = ["attr", "attrs"] can also be expressed as a similar JSON-formatted environment variable: fawltydeps_custom_mapping='{ \
"apache-airflow": ["airflow"], \
"atlassian-python-api": ["atlassian"], \
"attrs": ["attr", "attrs"] \
}' and both can end up in our settings.custom_mapping: Dict[str, Set[str]] = {
"apache-airflow": {"airflow"},
"atlassian-python-api": {"atlassian"},
"attrs": {"attr", "attrs"},
} This can also be achieved with the mapping stored in a separate file, but I don't yet see the advantages of keeping it separate? |
Check #256 to see how this fits into the overall mapping strategy.
The text was updated successfully, but these errors were encountered: