-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
exp init: add basic template support #6630
Conversation
The template is not usable yet in packages nor it will be initialized during 'dvc init' though. But it supports custom templates if user adds the template in .dvc/stages or in dvc's codebase on resources/stages.
LGTM so far,
Did you already think about how to include that support? I have a similar problem in #6550 and my research led me to |
This is stale, superseded by #6681. |
@pared, I have not researched about this yet, as I don't want to add the support till we are done with all the changes with |
This adds basic support for templating on
dvc exp init
.interactive
andexplicit
are not supported yet. The custom templates are supported,but right now, as we don't initialize it in
dvc init
, it has to be added manually in.dvc/stages
by theuser. I don't want to add that support yet before having this stable, as we may have some backward incompatible changes, so for testing, you'd have to do
mkdir .dvc/stages
yourself for a while.The default templates are not usable yet for binary packages users.
Note that the stage is appended after the template has been parsed, validated and then processed by stage when dumping, so it may not reflect the template very well, there may be formatting differences.
I tried using direct updates first, but doing that, it leaves formatting issues generated by templates (like whitespaces, empty newlines, etc.) and comment gets left-shifted. So, I went with the
stage.dump()
option. We could roll back to it if we want to in the future.In terms of code, all of the stuff related to initialization has been moved to
experiments.init
module, but I am still hesitant to add it torepo.experiments
as a new API.Also, it adds a dependency on
jinja2
. Regarding tests, I have only added simple ones and I don't plan to add until this feature starts taking shape.