Skip to content

Commit

Permalink
fix: compatibility issue with copier 8.0+ (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Aug 9, 2023
1 parent 16a1b30 commit 79a56a7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@ temp.py
# Pyannotate generated stubs
type_info.json
.pdm-build/
src/pdm/models/VERSION
2 changes: 1 addition & 1 deletion docs/docs/usage/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ To use them:
```bash
pdm init --cookiecutter gh:cjolowicz/cookiecutter-hypermodern-python
# or
pdm init --copier gh:pawamoy/copier-pdm
pdm init --copier gh:pawamoy/copier-pdm --UNSAFE
```
1 change: 1 addition & 0 deletions news/2177.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the compatibility issue with copier 8.0+.
2 changes: 1 addition & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pytest = [
"pytest",
"pytest-mock",
]
copier = ["copier"]
copier = ["copier>=8.0.0"]
cookiecutter = ["cookiecutter"]
keyring = ["keyring"]
template = [
Expand Down
4 changes: 3 additions & 1 deletion src/pdm/cli/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def _init_copier(self, project: Project, options: argparse.Namespace) -> None:

if not options.template:
raise PdmUsageError("template argument is required when --copier is passed")
_, retval = CopierApp.run([options.template, str(project.root), *options.generator_args], exit=False)
_, retval = CopierApp.run(
["copier", "copy", options.template, str(project.root), *options.generator_args], exit=False
)
if retval != 0:
raise RuntimeError("Copier exited with non-zero status code")

Expand Down

0 comments on commit 79a56a7

Please sign in to comment.