-
Notifications
You must be signed in to change notification settings - Fork 2
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
[SPIKE] Research methods of identifying unused dependencies #1221
Comments
Sasha Dresden commented: I think I found a solution that works for this: [https://deptry.com/|https://deptry.com/|smart-link] The nice thing about it in comparison to the others I looked at was that it was highly configurable from the {{pyproject.toml}} file. So for example when I ran I was getting a lot of false positives complaining about {{fecfiler}} but I was able to add that to the {{known_first_party}} and it would essentially ignore that issue. I could also tell it to ignore other rules as needed. For example, since the only place we use gunicorn is in the {{dockerfile }}and {{run-api.sh}}, which are done without a direct import call so it didn’t catch the usage of it. That type of situation was the hardest to capture with all of these tools, but deptry provided a simple way to ignore these as known requirements. There are some weaknesses to this. It only checks requirements.txt. Well, I had it run requirements-test.txt as a dev requirements, but it wasn’t very good at determining which of those were being used. Going back to the same issues with things like gunicorn or flake8. We don’t use it anywhere in the application, just used as part of the circle test, so it can’t seem to confirm what’s used or not there. It also doesn’t appear to check version, so if you accidentally used django 2 instead of 5 it would mark it as ok because you do have django. Some others I looked at in addition to the one mentioned in the ticket description: [https://pypi.org/project/pipreqs/|https://pypi.org/project/pipreqs/|smart-link] last updated Feb 2024. |
Sasha Dresden commented: Links to passing and failed circle tests for this branch: Failed: Passing: [https://app.circleci.com/pipelines/github/fecgov/fecfile-web-api/4653/workflows/c45469f7-3774-43de-9cf0-27607198ba1b/jobs/13307/parallel-runs/0/steps/0-118|https://app.circleci.com/pipelines/github/fecgov/fecfile-web-api/4653/workflows/c45469f7-3774-43de-9cf0-27607198ba1b/jobs/13307/parallel-runs/0/steps/0-118] |
Todd Lees commented: Solution found and ticket created: [https://fecgov.atlassian.net/browse/FECFILE-1878|https://fecgov.atlassian.net/browse/FECFILE-1878|smart-link] |
Shelly Wise commented: No code change or QA review needed on this ticket per DEV. Moved to Stage Ready. |
Research automated options for identifying unused dependencies in
requirements.txt
https://github.com/matthewhughes934/py-unused-deps seems like the type of thing we’re looking for but it’s low usage and contributor numbers take it out of the running in my book.
Upon completion of research, create follow-up tickets for actionable findings.
QA Notes
null
DEV Notes
null
Design
null
See full ticket and images here: FECFILE-1844
The text was updated successfully, but these errors were encountered: