-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
How to manage properly copier.yml using composition ? #237
Comments
yajo
pushed a commit
that referenced
this issue
Aug 19, 2020
Before this patch, using `!include` was a bit absurd because it would fail under any useful scenario: - Including with a glob. - Trying to include more than 1 file. Now all those are supported, and they can coexist. Besides, the patch is quite simple, which makes it more attractive. Fix #237.
yajo
pushed a commit
that referenced
this issue
Sep 5, 2020
Before this patch, using `!include` was a bit absurd because it would fail under any useful scenario: - Including with a glob. - Trying to include more than 1 file. Now all those are supported, and they can coexist. Besides, the patch is quite simple, which makes it more attractive. Fix #237.
yajo
pushed a commit
that referenced
this issue
Sep 5, 2020
Before this patch, using `!include` was a bit absurd because it would fail under any useful scenario: - Including with a glob. - Trying to include more than 1 file. Now all those are supported, and they can coexist. Besides, the patch is quite simple, which makes it more attractive. Fix #237.
github-actions bot
pushed a commit
that referenced
this issue
Sep 5, 2020
Before this patch, using `!include` was a bit absurd because it would fail under any useful scenario: - Including with a glob. - Trying to include more than 1 file. Now all those are supported, and they can coexist. Besides, the patch is quite simple, which makes it more attractive. Fix #237.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I've some questions about
copier.yml
composition, using!include
. You can find above my different tries, to have the context.Targets
The first point can be done quickly using
!include
as default value, and works well:But "problems" come with the second point, how to include top level keys (as questions are) into
copier.yml
file.Some tries to include top level content
Method 1: mixed content
Firstly, I've think about using composition mixing top level
!include
statements, but after some tries, it's not possible (see #236 ).Result: KO
Method 2: multiple top level
!include
But, not the expected output :)
YAML parser exception seems say : One top level
!include
per file, right ?Result: KO
Method 3: Multiple files
Another try ...
... but same result, because as the pyyaml-include documentation says:
Result: KO
Questions time
The documentation says in the Include other yaml files section: *Multiple files can be included per
copier.yml
.So,
!include
statements as values inside thecopier.yml
only ?!include
?My tries seem answer yes, yes, no, but is it right ?
If this is not possible today, I think the ability to import question can be really useful to keep config file smaller and avoid duplication between templates for common questions (smtp, repository, environments, licenses, ...).
Have a nice day !
The text was updated successfully, but these errors were encountered: