fpgmaas/deptry

Allow to specify other folders using dev-dependencies

MaxG87 opened this issue · 4 comments

I am working on a project that has a tests/ folder and a scripts/ folder. In scripts/ are some small programs that make my life as developer more convenient. They rely on the development dependencies and on the project itself, but that is okay.

However, deptry warns me that I import module from development dependencies, e.g. typer. I can ignore the entire folder, but then deptry will not warn me if I remove a dependency I need for one of these scripts.

I would like deptry to have an option extend_development_files (or similarly named) that would make deptry aware of other files and folders that should be treated just like the tests/ folder.

Since this is my third issue in short time, I also want to thank you for this wonderful tool. I am looking forward to incorporate it into my projects.

Hi @MaxG87, thanks for raising the issue! In this case, I personally would add scripts to the extend-exclude argument.

I would like deptry to have an option extend_development_files (or similarly named) that would make deptry aware of other files and folders that should be treated just like the tests/ folder.

The tests folder is currently simply ignored, see extend-exclude. I am not sure I fully understand the desired behavior, could you elaborate a bit more?

Yes, you are right, adding scripts to extend-exclude is the right thing to do.

When I wrote the comment I was assuming that there is a special treatment for tests. Similar to how deptry detects missing imports for everything under src/, it assumed it would detect missing imports for tests too.

Should I open a separate feature request for the detection of missing imports in tests/ and other folders?

@MaxG87 yes, that would make sense! Thanks for the suggestion.

The new feature request is #302. Since I mention the use case of this one there too, I am closing it for now.