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

Remove import search within current directory #611

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

apoorvkh
Copy link
Contributor

Currently, when a class is not already in Tango's registry, Tango will import files in hopes to locate that class.

In particular, Tango will import all files and modules in the current directory. As discussed in #606, this seems like unexpected / dangerous behavior (and has already caused problems for @jmerullo and I). As a solution, we have removed that code in this PR.

Instead, we feel that users should be responsible for importing packages or registering classes beforehand (i.e. before the classes are resolved by Tango, unless a class is a Tango built-in).

The existing alternatives seem like more appropriate solutions: it seems that the user can specify include-package as a tango run argument, in a .jsonnet config file, or in TangoGlobalSettings. And, modules can also be named according to their full package specification: e.g. examples.euler.complex_arithmetic.AdditionStep, instead of "cadd". So I believe this automatic local search can just be removed.

Please consider, thanks!

Made with contributions from Yingwei Song (@wrencanfly)

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

Successfully merging this pull request may close these issues.

None yet

2 participants