python -c 'import rjsonnet as j; f = j.evaluate_file("test.jsonnet", ext_codes={"data": "file.jsonnet"}); print(f);'
fails with
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: variable is not defined: file
from the code, ext_codes maps to context_initializer.add_ext_code which is supposed to handle both variable names and file paths
here test.jsonnet is something like
local i = std.extVar("data");
[i]
and file.jsonnet is
local data = {
a: "foo",
};
data
This works perfectly fine with jrsonnet
./jrsonnet --ext-code-file "data=new.jsonnet" test.jsonnet
with output
python -c 'import rjsonnet as j; f = j.evaluate_file("test.jsonnet", ext_codes={"data": "file.jsonnet"}); print(f);'fails with
from the code,
ext_codesmaps tocontext_initializer.add_ext_codewhich is supposed to handle both variable names and file pathshere test.jsonnet is something like
and file.jsonnet is
This works perfectly fine with jrsonnet
./jrsonnet --ext-code-file "data=new.jsonnet" test.jsonnetwith output