Closed GenevieveBuckley closed 8 months ago
Questions:
_subdirectory: {{repo_name}}
directly?A workaround that helped was to restructure the repository, so we had my_template/template/{{repo_name}}/README.rst.jinja, and in copier.yaml I wrote _subdirectory: template.
I found this line, so I think if I mess around with the extra_answers
dictionary values, I might be able to do it
https://github.com/12rambau/pytest-copie/blob/bd114eb5202933165f68e0ad98eb8d6ae6e06386/pytest_copie/plugin.py#L62
Describe the bug The example demo from the Usage docs page does not work. Multiple errors are produced.
To Reproduce Steps to reproduce the behavior:
copier.yaml
README.rst.jinja
:{{ short_description }}
copier
works on this example repo:cd ..; copier copy my_template my_output
. Observe that it works, and has created a "foobar" directory containing a README.rst file containing a "foobar" heading and the example short description.pytest
(withpytest-copie
on themy_template
repository:cd my_template; pytest --keep-copied-projects --pdb
Additional context There were a number of errors. I've found and made fixes for some easy ones, but am still not quite sure about some others.
_subdirectory: {{repo_name}}
tocopier.yaml
_subdirectory: {{repo_name}}
_subdirectory: "{{repo_name}}"
_subdirectory: \{\{repo_name\}\}
_subdirectory: my_template
_subdirectory: foobar
(I know this one is the silliest, but I was getting fed up)my_template/template/{{repo_name}}/README.rst.jinja
, and incopier.yaml
I wrote_subdirectory: template
. That worked, and got me to the next error.result.project_dir.name
is returningcopie0001
instead of the expectedfoobar
. This is possibly related to the subdirectory problem above, because if you look in the temporary pytest-copie folder that is generated, thefoobar
directory (and everything else we expect) does exist... it's just inside thecopie0001
temp folder. So if we can convince pytest-copie to look one level down for the project_dir, that might fix this.