Skip to content

Comments

pre-commit: move target directory from entry to args#1

Merged
francescorubbo merged 1 commit intofrancescorubbo:mainfrom
GideonBear:patch-1
Dec 14, 2025
Merged

pre-commit: move target directory from entry to args#1
francescorubbo merged 1 commit intofrancescorubbo:mainfrom
GideonBear:patch-1

Conversation

@GideonBear
Copy link
Contributor

@GideonBear GideonBear commented Dec 14, 2025

See also fpgmaas/deptry#1392, I made that but then realized it's a system hook so I can't use it. Thanks for the mirror!


Previously, running deptry in pre-commit when using a src directory:

  • with no args, results in DEP003 'mypackage' imported but it is a transitive dependency
  • with args: [ src ], results in double reports
  • with entry: deptry src, provides the correct behavior

However, entry is supposed to be an internal implementation detail, while args is meant for users to override. In this PR I've moved the directory to args so it can be overridden by args: [ "src" ] instead.

This is a breaking change, since anyone using args: [ "--something" ] will now be running deptry --something instead of deptry . --something, and need to edit their config to args: [ ".", "--something" ]. So feel free to deny if this isn't important enough to warrant that.

@francescorubbo
Copy link
Owner

Good point! Thank you for the fix. I'm wondering how to release it. Maybe a patch v0.24.0.1? I wouldn't want to get out of sync w/ the deptry releases.

@francescorubbo francescorubbo merged commit 287ca41 into francescorubbo:main Dec 14, 2025
@GideonBear GideonBear deleted the patch-1 branch December 15, 2025 09:13
@GideonBear
Copy link
Contributor Author

Maybe a patch v0.24.0.1?

Yes, that is probably the way to go.

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.

2 participants