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

Cookiecutter: Error when running "determining tier" cookiecutter #198

Open
natalialuzuriaga opened this issue Oct 31, 2024 · 2 comments
Open
Labels
bug Something isn't working cookiecutter

Comments

@natalialuzuriaga
Copy link
Collaborator

Describe the bug
When I run the cookiecutter file in the root directory to determine the tier of the project, an error occurs

To Reproduce
Steps to reproduce the behavior:

  1. Run cookiecutter . or cookiecutter https://github.com/DSACMS/repo-scaffolder in root directory
  2. See error:
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/cookiecutter/cli.py", line 203, in main
    cookiecutter(
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/cookiecutter/main.py", line 142, in cookiecutter
    nested_template = choose_nested_template(context, repo_dir, no_input)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/cookiecutter/prompt.py", line 363, in choose_nested_template
    val = prompt_choice_for_config(
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/cookiecutter/prompt.py", line 255, in prompt_choice_for_config
    rendered_options = [render_variable(env, raw, cookiecutter_dict) for raw in options]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/cookiecutter/prompt.py", line 224, in render_variable
    return template.render(cookiecutter=cookiecutter_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/Users/l9a1/Library/Application Support/pipx/venvs/cookiecutter/lib/python3.12/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
jinja2.exceptions.UndefinedError: 'collections.OrderedDict object' has no attribute 'CONTRIBUTORS'

Expected behavior
Cookiecutter prompts/questions show up in the command line and users are able to respond to them.

Additional context
This used to work before and no changes to this file have been made in a while, so I suspect this mustve been caused by an upstream change.

@cwren-usds
Copy link

can confirm: I just hit this bug too

@decause-gov
Copy link
Contributor

@natalialuzuriaga didn't we ship a solve for this recently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cookiecutter
Projects
None yet
Development

No branches or pull requests

3 participants