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

Requirements for the first prototype #5

Closed
Nour-Mws opened this issue Dec 14, 2022 · 5 comments
Closed

Requirements for the first prototype #5

Nour-Mws opened this issue Dec 14, 2022 · 5 comments

Comments

@Nour-Mws
Copy link
Collaborator

The goal of the first prototype is to reach a working and usable tool with minimal functionality.
Namely, a user would be able to run fawltydeps as a command line tool in their Python project. FawltyDeps will:

  • Automatically discover all Python code files (we would probably need to define an exclusion mechanism for .py files, e.g. setup.py, that are not to be parsed).
  • Extract all the libraries used (imported) in the code.
  • Automatically discover files declaring dependencies (supporting requirements.txt, setup.py and pyproject.toml).
  • For each of the files above, extract all declared dependencies.
  • Compare the two sets (of used vs declared dependencies) and output an error if a dependency is not declared and a warning if a dependency is declared but not used.

The first prototype will not:

  • Have a mechanism to exclude Python files or directories.
  • Have an extensive command line interface supporting the different options discussed in the design document (different mappings, local existing environments vs environment created from PyPI/Github, etc..)
  • Implement any mapping from imports to dependencies and vice versa (and subsequently no connection to PyPI and no creation of virtual environments).
@jherland
Copy link
Member

Looks very good to me. As for excluding setup.py, I'm not sure how many 3rd-party modules a file like that usually imports, so it should be fine to include it in the analysis, especially in the first prototype.

@Nour-Mws
Copy link
Collaborator Author

setup.py is the first thing that came to my mind and I agree that it isn't a very representative example as it probably would not have third party imports.
I remember I was exploring pigar with @mknorps and it just happened that the project we were on had a lot of spurious .py files. Let's get this aside for now until we have a concrete example. Maybe Maria will have a better memory.

@jherland
Copy link
Member

No worries. 😄 I fully agree both that (a) we will need an exclude mechanism eventually, and (b) we don't need one in the first version.

@mknorps
Copy link
Collaborator

mknorps commented Dec 16, 2022

From our tests, I think spurious *.py files came from narrowing down a directory we used to input the script.

Regarding python source code, we should think also of *.ipynb files. Let's include them in the first draft. This is a common problem that you cannot run someone's notebooks because you miss dependencies.

@mknorps
Copy link
Collaborator

mknorps commented Jan 5, 2023

Update the documentation with the requirements of the FawltyDeps, see #14, #12 .

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

No branches or pull requests

3 participants