Skip to content
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

feat: Parse templates in _answers_file setting #1027

Merged
merged 6 commits into from
Mar 25, 2023

Conversation

icj217
Copy link
Contributor

@icj217 icj217 commented Mar 6, 2023

Adds the ability for _answers_file to contain template variables. For example:

# copier.yml
_answers_file: ".copier-answers.{{ foo }}.yml"

foo:
  type: str

Closes #866

Since #882 seems to have been abandoned and the tests weren't actually working, I've opened up this PR instead.

@icj217 icj217 mentioned this pull request Mar 6, 2023
@nilsdebruin
Copy link
Contributor

Great! Would be nice if this feature is added!

Copy link
Member

@sisp sisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple of suggestions for improvement. But overall it looks good to me. 🙂

copier/main.py Show resolved Hide resolved
tests/test_answersfile_templating.py Outdated Show resolved Hide resolved
tests/test_answersfile_templating.py Outdated Show resolved Hide resolved
@icj217
Copy link
Contributor Author

icj217 commented Mar 8, 2023

@yajo Would you mind taking a look and approving the workflow runs?

@icj217
Copy link
Contributor Author

icj217 commented Mar 13, 2023

@sisp Are you able to trigger the workflow runs for this PR?

@sisp
Copy link
Member

sisp commented Mar 13, 2023

I don't think I can help because I have no permissions for this project.

@icj217
Copy link
Contributor Author

icj217 commented Mar 20, 2023

@yajo Sorry for the bump but wondering if you can approve these workflow runs?

@icj217
Copy link
Contributor Author

icj217 commented Mar 24, 2023

@yajo Any concerns with letting the workflows run?

@yajo
Copy link
Member

yajo commented Mar 25, 2023

Triggered! No concerns, just I had 120 emails from copier 😂

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty clean, thanks!

@codecov
Copy link

codecov bot commented Mar 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.36%. Comparing base (005a897) to head (5e9d7d7).
Report is 569 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1027      +/-   ##
==========================================
- Coverage   96.56%   96.36%   -0.20%     
==========================================
  Files          41       43       +2     
  Lines        3054     3247     +193     
==========================================
+ Hits         2949     3129     +180     
- Misses        105      118      +13     
Flag Coverage Δ
unittests 96.36% <100.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yajo yajo enabled auto-merge (squash) March 25, 2023 06:52
@yajo yajo merged commit d2de535 into copier-org:master Mar 25, 2023
@sisp sisp mentioned this pull request Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic answer file naming not working
5 participants