Short description:
When scaffolding a newly created GitLab repo via the command "cruft create -f [email protected]:radix-ai/poetry-cookiecutter.git", it fails with the following error (full error stack below):
FileNotFoundError: [Errno 2] No such file or directory: '<local_path>/{{ cookiecutter.package_name|slugify }}/tests/test_sentry.py'
Steps to reproduce:
- Create a new GitLab repo
- Clone it locally
- Scaffold it via the cruft create -f [email protected]:radix-ai/poetry-cookiecutter.git => you get the error.
Full logs / error message:
(base) ➜ VLAIO_HSCO cruft create -f [email protected]:radix-ai/poetry-cookiecutter.git
package_name [My Package]: HSCO
package_description [A Python package that ...]:
package_url [https://github.com/user/my-package]:
author_name [John Smith]:
author_email [[email protected]]:
python_version [3.8]:
with_fastapi_api [0]:
with_jupyter_lab [0]:
with_pydantic_typing [0]:
with_sentry_logging [0]:
with_streamlit_app [0]:
with_typer_cli [0]:
Select continuous_integration:
1 - GitHub
2 - GitLab
Choose from 1, 2 [1]: 2
Select docstring_style:
1 - NumPy
2 - Google
Choose from 1, 2 [1]:
private_package_repository_name []:
private_package_repository_url []:
Traceback (most recent call last):
File "/usr/local/bin/cruft", line 8, in
sys.exit(app())
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/typer/main.py", line 214, in call
return get_command(self)(*args, **kwargs)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/cruft/_cli.py", line 107, in create
_commands.create(
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/cruft/_commands/utils/init.py", line 14, in wrapper
return f(*args, **kwargs)
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/cruft/_commands/create.py", line 46, in create
generate_files(
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/cookiecutter/generate.py", line 352, in generate_files
generate_file(
File "/usr/local/Cellar/cruft/2.10.2/libexec/lib/python3.10/site-packages/cookiecutter/generate.py", line 179, in generate_file
with io.open(outfile, 'w', encoding='utf-8') as fh:
FileNotFoundError: [Errno 2] No such file or directory: '/{{ cookiecutter.package_name|slugify }}/tests/test_sentry.py'
Are you using the latest Cookiecutter 2.1.1 and Cruft 2.11.1? You can upgrade them with pip install --upgrade cookiecutter cruft.
That indeed solved the issue!
Tracked this in #114, and solved with #121.