documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Adding backend Plone add-on in backend/requirements.txt is ignored in backend/.gitignore in Cookieplone project

Open acsr opened this issue 9 months ago • 7 comments

Adding a Plone addon to the backend in backend/requirements.txt is not taken by git.

When you need to add an Plone addon to the backend and you follow the instructions on page /admin-guide/add-ons.html you would add the package to the file backend/requirements.txt, the change does not show up in git.

see: https://6.docs.plone.org/admin-guide/add-ons.html#install-an-add-on

Goal: Explain the right place to add the addons in the docs matching the Cookiecutter setup (or the other way round)

  • The docs should refer to the right place to add the addons and constraints in a Cookiecutter based setup!
  • or the Cookiecutter based setup needs to match the docs!
  • Optional: Add a reference to the related latest docs in the main README.md or backend/README.md

Solution?

I cannot suggest a PR because I am not aware of the latest changes and where the issue has to be fixed

backend/requirements.txt is covered in the backend/.gitignore rules

Version from the README.md: Generated using Cookieplone (0.9.6) and cookieplone-templates (696f111) on 2025-04-10 15:15:45.110547.

In this setup in the backend/.gitignore contains:

...
# mxdev
...
/*-mxdev.txt
...
constraints*.txt
requirements*.txt

Other stuff

There is no setup.py anymore

Former behaviour

Generated using Cookieplone (0.8.3) and cookiecutter-plone (91f7d2b) on 2025-02-13 18:18:49.930741.

In this former version of the cookieplone-template the backend/.gitignore contained:

...
# mxdev
...
/*-mxdev.txt
...

acsr avatar Apr 13 '25 14:04 acsr

I'm not sure if this is an issue for documentation or the backend cookieplone template. @davisagli @ericof can you advise?

Cookieplone now uses uv to manage dependencies, as its README.md states. @acsr can you try the following, and report back?

uv add <MY_DEPENDENCY>

See https://docs.astral.sh/uv/guides/projects/#managing-dependencies.

stevepiercy avatar Apr 13 '25 19:04 stevepiercy

@stevepiercy These docs are assuming there is a requirements.txt which is not the case for the new Cookieplone-generated scaffold with uv and pyproject.toml. We missed updating this after @ericof's refactoring. @ericof can you give pointers?

davisagli avatar Apr 15 '25 03:04 davisagli

@stevepiercy The solution is to edit pyproject.toml and add the "collective.easyform==4.2.1" inside dependencies:

[project[
...
dependencies = [
    ...
    "collective.easyform==4.2.1",
]

ericof avatar Apr 16 '25 19:04 ericof

@stevepiercy The solution is to edit pyproject.toml and add the "collective.easyform==4.2.1" inside dependencies:

[project[ ... dependencies = [ ... "collective.easyform==4.2.1", ]

@ericof why that specific dependency and pin? I'm missing something.

Also why not use uv, as I said in https://github.com/plone/documentation/issues/1938#issuecomment-2800085849?

stevepiercy avatar Apr 16 '25 23:04 stevepiercy

@stevepiercy the specific dependency and version are the ones currently used in the documentation, that is why I've used them.

ericof avatar Apr 16 '25 23:04 ericof

@ericof and my second question, Why not use uv instead of manually editing pyproject.toml?

https://docs.astral.sh/uv/guides/projects/#managing-dependencies

stevepiercy avatar Apr 16 '25 23:04 stevepiercy

@ericof reping.

stevepiercy avatar May 29 '25 22:05 stevepiercy