sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
52 stars 2 forks source link

Bug: When special variable is named in function there is a crash #153

Open robcxyz opened 1 year ago

robcxyz commented 1 year ago
<-:
  calling_directory->: "{{calling_directory}}"
  calling_file->: "{{calling_file}}"

Both these vars are brought into creating a declarative hook and so there is a duplicate value error.

        Function = create_model(
            func_name,
            __base__=BaseFunction,
            **new_func,
            **function_input.dict(include={'args', 'render_exclude'}),
            **{'function_dict': (dict, function_dict)},  # Preserve for `extends` key
            # https://github.com/sudoblockio/tackle/issues/99
            public_hooks=context.public_hooks,
            private_hooks=context.private_hooks,
            calling_directory=context.calling_directory,
            calling_file=context.calling_file,
            override_context=context.override_context,
            no_input=context.no_input,
            # Causes TypeError in pydantic -> __subclasscheck__
            # env_=context.env_,
        )