-
Notifications
You must be signed in to change notification settings - Fork 56
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
Enable to explicitly disallow import of certain external dependencies #535
Comments
Hi @janbernloehr , thanks for raising this. Can you provide a few more details about your use case? It sounds like you are maintaining multiple Python packages in your repo, are these built and released separately, or do they share an environment? My assumption about listing dependencies for each package was that every external package would need to be listed there anyway, is this not the case? I might be misunderstanding the workaround you are describing. |
Our usecase is that we have two packages foo and bar in our repo. We would like to prohibit foo from importing tensorflow and bar from importing torch. Instead of having a list of all external dependencies of foo we would rather just add tensorflow to the list of prohibited imports. |
I also have this use case and would find it really valuable. In lieu of tach supporting it we might end up using import-linter or similar. In our case, we want to limit the ability to import from eg |
@janbernloehr @samuelhwilliams Thanks for your patience here - just coming back to this. I'm still not sure I understand the behavior you are looking for, so let me sketch out my assumptions:
Since you are using In your specific example, I would think that tensorflow would simply not be listed in Could you let me know where I am going wrong here? An example of your project layout and Tach configuration may be helpful. |
We often have the usecase where for a certain package we want to disallow imports of an external package
foo
.Now to please
tach check-external
we would have to add all other packages to the dependencies which is cumbersome and requires frequent changes. Instead, we would like to explicitly model the forbidden external import offoo
only.The text was updated successfully, but these errors were encountered: