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

cookieplone does not accept a project name that exists of only one word #34

Closed
fredvd opened this issue Aug 14, 2024 · 4 comments · Fixed by #36
Closed

cookieplone does not accept a project name that exists of only one word #34

fredvd opened this issue Aug 14, 2024 · 4 comments · Fixed by #36

Comments

@fredvd
Copy link
Member

fredvd commented Aug 14, 2024

cookieplone only accepts project names with multiple words. Otherwise there is a traceback. For example a project name plone6test is not valid.

 -> Setup Backend
Traceback (most recent call last):
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/cookieplone/generator.py", line 56, in generate
    result = cookiecutter(
             ^^^^^^^^^^^^^
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/cookiecutter/main.py", line 161, in cookiecutter
    prompt_for_config(context_for_prompting, no_input)
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/cookiecutter/prompt.py", line 283, in prompt_for_config
    cookiecutter_dict[key] = render_variable(env, raw, cookiecutter_dict)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/cookiecutter/prompt.py", line 224, in render_variable
    return template.render(cookiecutter=cookiecutter_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/Users/fred/.local/pipx/venvs/cookieplone/lib/python3.12/site-packages/cookieplone/filters/__init__.py", line 14, in package_name
    return v.split(".")[1]
           ~~~~~~~~~~~~^^^
IndexError: list index out of range
@acsr
Copy link

acsr commented Nov 13, 2024

same with a tripled project name with two dots inside like test.plone.volto (using Cookieplone 0.7.1)
maybe fixed with PR:

#36
#44

@acsr
Copy link

acsr commented Nov 13, 2024

same with Cookieplone 0.8.0

A tripled namespace test.plone.something results in

+ /home/astro/Plone6/Test/test-plone-something/backend/.venv/bin/uv pip install -r requirements-mxdev.txt
error: Build backend failed to determine requirements with `build_editable()` (exit status: 1)

[stderr]
error in test.plone.kwk setup command: Distribution contains no modules or packages for namespace package 'test.plone'
make[2]: *** [Makefile:69: build-dev] Error 2
make[2]: Leaving directory '/home/astro/Plone6/Test/test-plone-something/backend'
make[1]: *** [Makefile:63: backend-install] Error 2
make[1]: Leaving directory '/home/astro/Plone6/Test/test-plone-something'
make: *** [Makefile:89: install] Error 2

@davisagli
Copy link
Member

@acsr The fix for this was just merged today in plone/cookieplone-templates#86 -- please try again

@acsr
Copy link

acsr commented Nov 15, 2024

THX here as well. works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants