Skip to content

Conversation

@ericof
Copy link
Member

@ericof ericof commented Oct 2, 2025

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • I verified there aren't any other open pull requests for the same change.
  • I followed the guidelines in Contributing to Plone.
  • I successfully ran code quality checks on my changes locally.
  • I successfully ran tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes.
  • I included a change log entry in my commits.

If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes #

clean: ## Clean installation and instance
@echo "$(RED)==> Cleaning environment and build$(RESET)"
@rm -rf $(VENV_FOLDER) pyvenv.cfg .installed.cfg instance/etc .venv .pytest_cache .ruff_cache constraints* requirements*
@rm -rf $(VENV_FOLDER) pyvenv.cfg .installed.cfg instance .venv .pytest_cache .ruff_cache constraints* requirements*
Copy link
Member

Choose a reason for hiding this comment

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

Please make sure this still doesn't delete the site data.

description="Uninstall {{ cookiecutter.title }} setup."
provides="Products.GenericSetup.interfaces.EXTENSION"
directory="profiles/uninstall"
/>
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

How many times do we actually use the Uninstall profile on a project package? This package is meant to be very specific and configure Plone for a one usage.

This is the same scenario of a distribution where when you create a site based on that, you are all in.

For an add-on it is a very different game, as I want to be able to install / remove it over the lifetime of a portal.

Copy link
Member

Choose a reason for hiding this comment

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

@ericof I understand the distinction between a project and an add-on. But this is the template I would use if I want to create an add-on with both backend and frontend, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. This template will focus only on the project monorepo.
I plan to have two other monorepo variants:

  • Add-on
  • Distribution

Copy link
Member

Choose a reason for hiding this comment

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

@ericof Okay, but then let's please not remove things that are relevant to the other use cases until we have a replacement.

Copy link
Member

Choose a reason for hiding this comment

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

(I know this is still a draft for now, so no actual problem to fix.)

"Dockerfile",
"instance.yaml",
"Makefile",
"mx.ini",
Copy link
Member

Choose a reason for hiding this comment

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

We still need a solution for installing editable packages from git clones.

Copy link
Member Author

Choose a reason for hiding this comment

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

We do need one, but I've been using editable checkouts pointing to a local directory with very good results. Of course, this is not a solution for the complete development cycle but it is what we have for today with uv.

plone-exportimport = { path = "../../../Plone/Core/plone.exportimport", editable = true }

Copy link
Member

Choose a reason for hiding this comment

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

@ericof The goal is that you can check out a repository, run make install, and have any necessary editable dependencies installed. Probably this means a Makefile command which does the cloning prior to running uv sync. And we need to document it.

Copy link
Member

Choose a reason for hiding this comment

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

@ionlizarazu and me have been testing producing pip lock files (see #291) and we have also tested to produce uv lock files.

To do so, we have to set the project to be managed (setting [tool.uv] managed= true in pyproject.toml) and we have to remove the main-package = -e .[test] configuration in mx.ini.

After doing that, the rest of the mx.ini file keeps working, and uv installs whatever we set in this file as an editable install.

I need more testing on this, but I would say that we can go with both uv lock files and mx.ini.

@@ -0,0 +1 @@
Refactor monorepo project to use uv and repoplone. @ericof
Copy link
Member

Choose a reason for hiding this comment

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

We should also mention the refactor of the CI pipeline

Copy link
Member Author

Choose a reason for hiding this comment

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

This is still a day or two from being done, but I will make sure to add the changelog entries for the CI and for the base Docker images

@erral
Copy link
Member

erral commented Oct 10, 2025

Perhaps I am a bit late to the party, but can we split the PR, one step introducing the repoplone, and another step introducing the uv lock files?

I think it is easier to explain to the wider community and users of this tool if we go step by step and if we do not do an big overhaul of the tool in a very short time.

@ericof
Copy link
Member Author

ericof commented Oct 10, 2025

I'm leaning into refactoring this PR into a new template (monorepo-ex) with all things introduced here and leave the existing monorepo template as it is.

After all, what is being implemented here is already being used in production for the last few months.

Opinions @erral, @davisagli?

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.

@ericof Things I like here:

  • moving the ansible stuff to a separate template
  • updating the GHA workflows to use the shared workflows from plone/meta

I am not yet convinced we should switch to managing all Python dependencies using pyproject.toml and uv sync. Yes, we've been using that for some projects over the past few months and we've managed to make it work. But so far I don't see that it has any big benefit. Before, we needed an extra tool (mxdev) to create a final set of constraints and clone packages from git. After, we still need an extra tool (repoplone) to update the constraints in pyproject.toml, and we still need a solution outside of uv to clone packages from git.

Actually I don't see here where you are doing anything here to use the correct set of constraints for the selected Plone version.

Without a clear motivation to switch, I would rather keep the current solution. There is a cost to switching, because we have to educate the community about the new way, and create documentation which explains both the old and new way.

Let's talk about it. Maybe there are some important benefits to the change which I am forgetting at the moment.

@ericof
Copy link
Member Author

ericof commented Oct 12, 2025

@davisagli

ATM the management of the constraints is done via repoplone and the main goal is to advance us in the path of adopting distributions -- like kitconcept.intranet and Portal Brasil.

There are other ways of handling lockfiles, but as uv seems to be the one with more traction, I decided to follow that path.

I'm going to use this branch on my training, add a gigantic warning this is experimental, and document as much as I can.

@davisagli
Copy link
Member

There are other ways of handling lockfiles, but as uv seems to be the one with more traction, I decided to follow that path.

We should take a look at the pylock.toml format that was accepted as a PEP in March (https://peps.python.org/pep-0751/) and is already supported by uv.

I'm going to use this branch on my training, add a gigantic warning this is experimental, and document as much as I can.

Sure, I have no problem with that. I just don't want to rush updating the template on main. (I would already be okay with separate PRs to make the separate ansible subtemplate and switch to using the shared GHA workflows, though.)

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.

5 participants