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

#18: Add checker for unused and undeclared dependencies #20

Conversation

nifadyev
Copy link
Contributor

@nifadyev nifadyev commented Dec 9, 2024

The PR contains configuration examples for deptry and fawltydeps.

The main differences are:

  • deptry unable to find such undeclared dependencies as celery,
  • fawltydeps requires fine-grained configuration to avoid false positives like django (Django in pyproject.toml). deptry converts package names to camel_case if necessary
  • both have custom mapping for such packages as django-environ (imported as environ)
  • deptry requires more configuration for Django projects to avoid false positives for packages which are not used in codebase (for example, django-cors-headers)
  • fawltydeps unable to resolve packages from private pypi (core-python-client, .etc)

As a result, neither of these tools is good enough. But they can be used in tandem to achieve desired behavior. Unfortunately, with extra configuration.

Detailed output could be found in deptry_worklogs_toggl_output.txt and fawltydeps_worklogs_toggl_output.txt

Resolves #18

@soltanoff
Copy link
Member

@nifadyev, thank you! That's awesome feature

@@ -84,6 +84,8 @@ lint:
make check
@# For some reason, mypy and pylint fails to resolve PYTHONPATH, set manually.
PYTHONPATH=./app $(MANAGER) run pylint app
$(MANAGER) run deptry backend
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's better for us.

@nifadyev nifadyev force-pushed the infra/#18/add-check-for-unused-and-undeclared-deps branch from a3fcf1c to 08220e5 Compare December 9, 2024 15:43
@soltanoff soltanoff merged commit f4af2a8 into evrone:master Dec 9, 2024
@nifadyev nifadyev deleted the infra/#18/add-check-for-unused-and-undeclared-deps branch December 9, 2024 15:45
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

Successfully merging this pull request may close these issues.

Add checker for unused and undeclared dependencies
2 participants