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

Make the source paths configurable #177

Closed
mkniewallner opened this issue Nov 9, 2022 · 3 comments · Fixed by #381
Closed

Make the source paths configurable #177

mkniewallner opened this issue Nov 9, 2022 · 3 comments · Fixed by #381
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@mkniewallner
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Python projects use different structures to organise their modules.

Libraries nowadays tend to have an src directory holding the applicative code, while other projects might play with PYTHONPATH to consider some specific packages as source directories discoverable by Python.

deptry doesn't provide any way to account for this flexibility today, preventing those projects from using the library.

Describe the solution you would like

A way to solve both issues could be to allow setting the source paths for the code as an array, similarly to what isort does.

@mkniewallner mkniewallner added the enhancement New feature or request label Nov 9, 2022
@mkniewallner
Copy link
Collaborator Author

While this is not exactly the solution highlighted in this issue, #244 at least make it possible to specify a source directory other than . while still reading pyproject.toml from where deptry is run, which should serve projects using src layouts, partially resolving this issue.

I still think that being able to define multiple source paths might be convenient for some projects, so let's keep this issue open.

@zmievsa
Copy link

zmievsa commented Jan 19, 2023

Which popular libraries prefer to have src? I see an entirely different pattern.

@mkniewallner
Copy link
Collaborator Author

Which popular libraries prefer to have src? I see an entirely different pattern.

Sorry for the late reply, I missed your comment somehow.

Out of my head, here are some popular repositories that use src:

@mkniewallner mkniewallner added this to the 0.11 milestone May 10, 2023
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

Successfully merging a pull request may close this issue.

2 participants