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

Support handling implicit dependencies from __init__.py #703

Open
msu-reevo opened this issue Mar 21, 2025 · 1 comment
Open

Support handling implicit dependencies from __init__.py #703

msu-reevo opened this issue Mar 21, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@msu-reevo
Copy link

We recently saw issues with implicit dependencies being imported from __init__.py

Example:

  • app/module/__init__.py
  • app/module/workflows/fragile.py
  • the second one will implicitly import anything from the __init__.py which the person in the fragile.py is not aware of from reading the code.

Would love to be able to report the implicit dependencies or block imports or apply layer or import rules to them.

@emdoyle emdoyle added the enhancement New feature or request label Mar 31, 2025
@emdoyle
Copy link
Member

emdoyle commented Apr 1, 2025

I'd like to support this, but I also want to make sure that it is implemented in a reasonable way. If this were available as a global opt-in, would you enable it?

My main concern is that this would be 'noisy' if any __init__.py files use the relatively common pattern of 're-exporting' members from all its child modules e.g.

from .submodule1 import SubModuleOne
from .submodule2 import SubModuleTwo
from .submodule3 import SubModuleThree

With the option on, any instance of that pattern would indicate to Tach that all three submodules depend on each other (if I understand correctly). Could you tell me more about the case you would want to cover? Or maybe you would expect to configure it a bit differently?

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