diff --git a/.gitignore b/.gitignore index 714ac0d8e7..cb2513abc2 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,4 @@ temp.py # Pyannotate generated stubs type_info.json .pdm-build/ +src/pdm/models/VERSION diff --git a/docs/docs/usage/template.md b/docs/docs/usage/template.md index 64652128ed..232567c54a 100644 --- a/docs/docs/usage/template.md +++ b/docs/docs/usage/template.md @@ -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 ``` diff --git a/news/2177.bugfix.md b/news/2177.bugfix.md new file mode 100644 index 0000000000..472b6214bd --- /dev/null +++ b/news/2177.bugfix.md @@ -0,0 +1 @@ +Fix the compatibility issue with copier 8.0+. diff --git a/pdm.lock b/pdm.lock index 13b53203ce..e3e169dfc6 100644 --- a/pdm.lock +++ b/pdm.lock @@ -6,7 +6,7 @@ groups = ["default", "all", "doc", "pytest", "test", "tox", "workflow"] cross_platform = true static_urls = false lock_version = "4.3" -content_hash = "sha256:ac589b0b9f40317e0a1c3109d28ec8b02acfa1ce164e4ef69d090fdcb70987a3" +content_hash = "sha256:ad6e1f6a51451097dfee550fb24daf4a09f43adc3bb8facc5e6512021d604526" [[package]] name = "arpeggio" diff --git a/pyproject.toml b/pyproject.toml index 204027d74e..9284c29692 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ pytest = [ "pytest", "pytest-mock", ] -copier = ["copier"] +copier = ["copier>=8.0.0"] cookiecutter = ["cookiecutter"] keyring = ["keyring"] template = [ diff --git a/src/pdm/cli/commands/init.py b/src/pdm/cli/commands/init.py index 18db20b004..abd7b74216 100644 --- a/src/pdm/cli/commands/init.py +++ b/src/pdm/cli/commands/init.py @@ -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")