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

Support python 3.13 and drop python 3.8 and 3.9 #131

Merged
merged 3 commits into from
Jan 27, 2025

Conversation

ichim-david
Copy link
Member

@ichim-david ichim-david commented Jan 26, 2025

Fixes #130

project/README.md Outdated Show resolved Hide resolved
backend_addon/hooks/pre_prompt.py Show resolved Hide resolved
project/hooks/pre_prompt.py Show resolved Hide resolved
Copy link

@rohnsha0 rohnsha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on Python 3.13.1, building complete project!

 -> Initialize Git repository
 -> Setup Backend
Traceback (most recent call last):
  File "/tmp/tmpzm2e3o52.py", line 180, in <module>
    main()
    ~~~~^^
  File "/tmp/tmpzm2e3o52.py", line 146, in main
    func(new_context, output_dir)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/tmpzm2e3o52.py", line 63, in generate_backend_addon
    generator.generate_subtemplate(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        "backend_addon", output_dir, folder_name, context, BACKEND_ADDON_REMOVE
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/rohnsha0/code/plone/cookieplone-templates/lib/python3.13/site-packages/cookieplone/generator.py", line 104, in generate_subtemplate
    repository = _get_repository_root(context, template)
  File "/home/rohnsha0/code/plone/cookieplone-templates/lib/python3.13/site-packages/cookieplone/generator.py", line 37, in _get_repository_root
    raise exc.RepositoryNotFound()
cookiecutter.exceptions.RepositoryNotFound
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

@stevepiercy
Copy link
Contributor

@rohnsha0 did you use the changes in this PR?

@rohnsha0
Copy link

rohnsha0 commented Jan 27, 2025

@rohnsha0 did you use the changes in this PR?

Yep! I've used the same branch as in this PR!

@rohnsha0
Copy link

The main branch fails as not supported version as in preprompt script

@rohnsha0
Copy link

Running backend_addon/ module explicitly gives zero errors and works as expected... but if running on project/ gives the above error!

@ichim-david ichim-david changed the title Support python 3.13 Support python 3.13 and drop python 3.8 and 3.9 Jan 27, 2025
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This LGTM, but let's get a maintainer, too.

@stevepiercy
Copy link
Contributor

FYI, @rohnsha0 comments are for an unrelated issue, once he was able to run Cookeplone with your PR on Python 3.13.

@rohnsha0
Copy link

wait, dont merge now!

@rohnsha0
Copy link

rohnsha0 commented Jan 27, 2025

the PR still throws the same error...
needs to be fixed before merging!

FYI, @rohnsha0 comments are for an unrelated issue, once he was able to run Cookeplone with your PR on Python 3.13.

sorry for the confusion, the reviews for this PR was tested on this branch for the same error, and still throws the same error!

@stevepiercy
Copy link
Contributor

stevepiercy commented Jan 27, 2025

@rohnsha0 it sounds like you're talking about installing or running the generated project, not just generating the project. This PR is intended to resolve only being able to run Cookieplone on Python 3.13 to generate a project. If your issue arises after you have generated the project, then you try to build, install, or run your project, then you must create a new separate issue and not hijack this PR.

@ichim-david
Copy link
Member Author

ichim-david commented Jan 27, 2025

@rohnsha0 I don't know how you are testing and what is the fault of your error.
I have made a video which I am attaching bellow where I am showing what my pull request does, which is simply to allow python 3.13 to be used as the python3 version.

python3-13-cookieplone.mp4

If you try with my branch and you still get the same error I suggest you open a new issue for it to be tracked separately from this work which simply allows the use of python 3.13 to be used as the python version to generate the project, backend or frontend addon boilerplate.

@rohnsha0
Copy link

I am so sorry @stevepiercy @ichim-david
My COOKIEPLONE_REPOSITORY wasn't correct and due to that it was failing with explicit warning that repo not found....
Sorry for the unwanted blockage caused! Apologies!

Copy link

@rohnsha0 rohnsha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works!

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ichim-david I thought I had taken care of this in plone/cookieplone#55, but it seems my testing was flawed. This looks good and works for me. Thanks for taking care of it!

@davisagli davisagli merged commit 42ad621 into main Jan 27, 2025
16 checks passed
@davisagli davisagli deleted the 130-support-python-313 branch January 27, 2025 18:55
@ichim-david
Copy link
Member Author

@davisagli yup I was going to say that I noticed that you added the support for cookieplone itself but it seems that there were still a small hiccup with the pre script. Then it turned into a bit more of a change after @stevepiercy suggestions and here we are now :).
Glad to help, now I only have the mystery of how to create the addons and to get the project updated as I've asked you here #109 (comment)

@davisagli
Copy link
Member

@ichim-david I'm working through my inbox and will get to your question eventually.

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 this pull request may close these issues.

Support python 3.13 when trying to use cookieplone to generate a Plone project
4 participants