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

Allow to specify other folders using dev-dependencies #300

Closed
MaxG87 opened this issue Feb 20, 2023 · 4 comments
Closed

Allow to specify other folders using dev-dependencies #300

MaxG87 opened this issue Feb 20, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@MaxG87
Copy link

MaxG87 commented Feb 20, 2023

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.

@MaxG87 MaxG87 added the enhancement New feature or request label Feb 20, 2023
@fpgmaas
Copy link
Owner

fpgmaas commented Feb 21, 2023

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?

@MaxG87
Copy link
Author

MaxG87 commented Feb 22, 2023

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?

@fpgmaas
Copy link
Owner

fpgmaas commented Feb 22, 2023

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

@MaxG87 MaxG87 changed the title Allow to specify othet dependency folders Allow to specify other folders using dev-dependencies Feb 22, 2023
@MaxG87
Copy link
Author

MaxG87 commented Feb 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants