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

Idea: A project analyzer/detective module to be used as a FawltyDeps frontend #375

Open
jherland opened this issue Oct 2, 2023 · 0 comments

Comments

@jherland
Copy link
Member

jherland commented Oct 2, 2023

In relation to our ongoing experiment where we analyze popular PyPI experiment, I've been thinking about what the eventual fallout from this could be, in terms of new FawltyDeps features/improvements.

One thing we're looking to do is to get better at detecting what kind of project we're looking at, and automatically tuning the behavior of FD accordingly:

  • E.g. in a project that uses pip-tools to pip compile a requirements.in file into a requirements.txt file, we would want FD to only look at the requirements.in file by default (i.e. --deps=requirements.in)
  • We would want FD to be smarter about where the code in a projects is located, e.g. make it possible to skip test code, etc.
  • As demonstrated by issues like Support for Django apps which are used in project but not directly imported #373, we would like FD to detect other aspects of the project that should affect its behavior.

If we try to bake these detectors/behavioral adjustments into FD itself, it will likely complicate the internal logic considerably, and make FD less maintainable over time. Instead, I propose a separate module/package for project detection whose sole purpose is to look at a Python project and come up with the appropriate settings for FawltyDeps to use by default.

This could be run as a one-off thing, e.g. you run fawltydeps-detect >> pyproject.toml to produce a TOML config section for FawltyDeps to use later, or it could be something that is run by FD as an initial phase of the analysis. It could even be structured as a wizard that asks the user relevant questions (if necessary).

The main idea is that this component:

  • is separately testable
  • has a clear and unambiguous interface to the rest of FD, namely the FD settings object.
  • collects logic about a wide variety of Python project types, so that FD can remain relatively agnostic and ignorant of these details.
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

1 participant