-
Notifications
You must be signed in to change notification settings - Fork 20
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
Avoid Cargo as a dependency for using deptry with pre-commit #592
Comments
Hey, sorry for that, indeed, we should probably do something similar to https://github.com/astral-sh/ruff-pre-commit and https://github.com/pre-commit/mirrors-mypy and store hooks in a separate repository, so that we can depend on wheels. We'll work on that soon, in the meantime the solution you suggest should work. |
Checking https://github.com/fpgmaas/deptry/blob/45b1e13926d37e725c0d328fb5ef5dece3d48139/.pre-commit-hooks.yaml, our current hook uses But although not really related to this issue, IMO our current hook is probably not that helpful, as if we end up relying on Given that an option to define the mapping of packages to modules exists, I wonder if we could not have a |
The main question I have with that solution is; why would a user choose to run the pre-commit hook in its own environment and define the mapping manually from scratch, rather than use the pre-commit hook as a |
For me, I haven't been successfully been able to use deptry as a pre-commit (git) hook when calling
Which implies the virtual environment is not being activated. But as far as I understand this is the intended behaviour of So that means This is why I've been using |
One other reason to move to a |
Is your feature request related to a problem? Please describe.
As of v0.14.0, building
deptry
requires Cargo to be installed.Since
pre-commit
builds the pre-commits locally, this means that usingdeptry
with pre-commit requires Cargo.Describe the solution you would like
I think the documentation could be updated to explain this fact.
An alternative way to use deptry with pre-commit would be to get it to run locally:
Or perhaps using
language: system
and not includingadditional_dependencies
explicitly.Perhaps this could be suggested as a recommended workaround, in the documentation.
Additional context
See #590.
The text was updated successfully, but these errors were encountered: