earthmover
earthmover copied to clipboard
Jinja imports broken in package composition
Jinja allows imports. This works in standalone projects, but breaks on composition in a few ways:
- An earthmover project can have a config YAML file import some Jinja; however, installing that project as a dependency in another project via
earthmover depsfails because the import statement now looks in the wrong directory when rendering that config. - A destination template can also import some Jinja and work outside of package composition; however,
earthmover runfails because earthmover looks for the template from the root directory of the importing project.
Somewhat minimal reproducible example attached in jinja_em_composition.tar.gz:
dependencyrepresents an earthmover project with a Jinja import in its config YAML.- Running
earthmover compile -c dependency/earthmover.yamldemonstrates that the import in the config is valid Jinja and produces a validearthmover_compiled.yaml. - running
earthmover run -c dependency/earthmover.yamldemonstrates that the import in the template is valid Jinja and produces valid output.
- Running
- Running
earthmover deps -c earthmover.yamlfrom the root directory should fail:ERROR Jinja syntax error in YAML configuration template, near line 3 ('template.jinja' not found in search path: '.')