Remove import search within current directory #611
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 atango run
argument, in a.jsonnet
config file, or inTangoGlobalSettings
. 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)