Skip to content
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

User-defined mapping: add pyproject.toml section parser #290

Closed
Tracked by #256
mknorps opened this issue Apr 3, 2023 · 2 comments · Fixed by #292
Closed
Tracked by #256

User-defined mapping: add pyproject.toml section parser #290

mknorps opened this issue Apr 3, 2023 · 2 comments · Fixed by #292
Assignees
Labels
P2 major: an upcoming release

Comments

@mknorps
Copy link
Collaborator

mknorps commented Apr 3, 2023

Following @jherland's comment in #260, a user should be able to define a custom mapping in pyproject.toml:

[tool.fawltydeps.custom_mapping]
apache-airflow = ["airflow"]
atlassian-python-api = ["atlassian"]
attrs = ["attr", "attrs"]
@mknorps mknorps added this to the Mapping strategy milestone Apr 3, 2023
@mknorps mknorps added the P2 major: an upcoming release label Apr 3, 2023
@mknorps
Copy link
Collaborator Author

mknorps commented Apr 3, 2023

Comment in #287 by @jherland to be considered when implementing:

Also, in relation to what we discussed earlier about using a separate file vs. using a [tool.fawltydeps.custom_mapping] section in pyproject.toml (and in a future PR):

  • Can we have this option default to the same file as --config-file, and:
  • When it's the same as --config-file, look for the mappings inside the [tool.fawltydeps.custom_mapping] section, or:
  • Otherwise, look for the mappings at the top-level of the given TOML file.

@mknorps
Copy link
Collaborator Author

mknorps commented Apr 3, 2023

To be able to better distinguish between mapping collected from file and user-defined mapping manually added to pyproject.toml, I propose, we split it to two sections:

[tool.fawltydeps.custom_mapping]
apache-airflow = ["airflow"]
atlassian-python-api = ["atlassian"]
attrs = ["attr", "attrs"]

[tool.fawltydeps.custom_mapping_file]
relative_path/to_my.file.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant