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

Make the list of resolvers user-configurable #273

Closed
Nour-Mws opened this issue Mar 27, 2023 · 1 comment
Closed

Make the list of resolvers user-configurable #273

Nour-Mws opened this issue Mar 27, 2023 · 1 comment

Comments

@Nour-Mws
Copy link
Collaborator

From #256 (comment):

Only provide options to enable/disable resolvers, not reorder them.

  • Does not make sense to have ID mapping anywhere other than at the bottom of the stack
  • Does not make sense to reorder PyPI vs --pyenv
  • A user-provided mapping should always have the highest priority.

This can be done e.g via:

  • Add a new option: --use-mappings that takes a sequence of "magic" words that correspond to the boxes in the diagram:
    • custom: [tool.fawltydeps.custom_mapping] from config file (if it exists). [^1]
    • pyenv: Any --pyenv option(s) given on the command or in the config file.
    • basepath: Any Python environments discovered under basepath i.e. in the current "project' (for lack of a better word). [^2]
    • current: The Python environment that FD is currently running in (aka sys.path).
    • pypi: The various components that make up the PyPI logic.
    • id: The identity mapping.
  • The user can pass --use-mappingswith their own list to reorder and skip any of the mappings corresponding to the above words. In other words, advanced users have full control.
  • The default value of --use-mappings (based on the above diagram) is: --use-mappings=custom,pyenv,basepath,current,id (pypi is off by default).
  • Add a --use-pypi option to insert pypi before the id mapping in the default list, i.e. equivalent to --use-mappings=custom,pyenv,basepath,current,pypi,id
  • Add a --use-pyenv-only option to reduce the list to --use-mappings=pyenv
  • Consider adding more options to satisfy common user scenarios.
  • Make all of these options mutually exclusive to prevent confusing scenarios with option combinations that don't make sense. (e.g. --use-pyenv-only --use-pypi).
@jherland
Copy link
Member

jherland commented Aug 1, 2023

Leaving this issue as not planned for now. We might want to revisit it later if/when we need more customizability in this area.

@jherland jherland closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants