-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Overhaul Manage Add-ons and Packages #1724
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0d3963c
Overhaul Manage Add-ons and Packages
stevepiercy fc78599
Merge branch '6.0' into manage-add-ons-reorg
stevepiercy 477e242
Add a redirect
stevepiercy b5b4716
Move cookiecutter info to Glossary
stevepiercy a1e30c9
Move Configuration with `cookiecutter-zope-instance` to manage/backen…
stevepiercy 14ad6f2
Remove manage-add-ons-packages.md
stevepiercy 01289bf
Merge branch '6.0' into manage-add-ons-reorg
stevepiercy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
myst: | ||
html_meta: | ||
"description": "Conceptual guides provide explanation of concepts to deepen and broaden your understanding of Plone." | ||
"property=og:description": "Conceptual guides provide explanation of concepts to deepen and broaden your understanding of Plone." | ||
"property=og:title": "Conceptual guides" | ||
"keywords": "Plone 6, Conceptual guides" | ||
--- | ||
|
||
# Conceptual guides | ||
|
||
This part of the documentation provides explanation of concepts to deepen and broaden your understanding of Plone. | ||
|
||
|
||
```{toctree} | ||
:maxdepth: 2 | ||
|
||
package-management | ||
make-build-backend-walk-through | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
myst: | ||
html_meta: | ||
"description": "make build-backend in Plone." | ||
"property=og:description": "make build-backend in Plone." | ||
"property=og:title": "make build-backend details" | ||
"keywords": "Plone 6, make, build-backend" | ||
--- | ||
|
||
(make-build-backend-details-label)= | ||
|
||
# `make build-backend` details | ||
|
||
This chapter assumes you have previously followed {doc}`/install/create-project`. | ||
|
||
The `Makefile` at the root of your project invokes commands in `backend/Makefile`. | ||
Here are excerpts from `backend/Makefile` to show details of the `make build-backend` command. | ||
|
||
```makefile | ||
bin/pip: | ||
@echo "$(GREEN)==> Setup Virtual Env$(RESET)" | ||
python3 -m venv . | ||
bin/pip install -U "pip" "wheel" "cookiecutter" "mxdev" | ||
|
||
instance/etc/zope.ini: bin/pip | ||
@echo "$(GREEN)==> Install Plone and create instance$(RESET)" | ||
bin/cookiecutter -f --no-input --config-file instance.yaml https://github.com/plone/cookiecutter-zope-instance | ||
mkdir -p var/{filestorage,blobstorage,cache,log} | ||
|
||
# ... | ||
|
||
.PHONY: build-dev | ||
build-dev: instance/etc/zope.ini ## pip install Plone packages | ||
@echo "$(GREEN)==> Setup Build$(RESET)" | ||
bin/mxdev -c mx.ini | ||
bin/pip install -r requirements-mxdev.txt | ||
``` | ||
|
||
The command `make build-backend`: | ||
|
||
- Invokes the target `build-dev` target in `backend/Makefile`. | ||
- This invokes the target `instance/etc/zope.ini`. | ||
- This invokes the target `bin/pip`. | ||
|
||
- This creates a `Python` virtual environment if one does not exist. | ||
- It installs and upgrades Python package management tools in that virtual environment. | ||
|
||
- Returning to the target `instance/etc/zope.ini`: | ||
|
||
- This creates or updates the Zope configuration from its `instance.yaml` file using `cookiecutter-zope-instance`. | ||
- Creates specified directories, if they do not exist. | ||
|
||
- Returning to the target `build-dev`: | ||
|
||
- This generates the `mxdev` files as described above in {ref}`manage-mxdev-usage-overview-label`. | ||
- Installs Plone core packages and add-ons from the files generated by `mxdev`. | ||
|
||
You can configure your Zope instance as described in the section {ref}`manage-common-management-tasks-label`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
myst: | ||
html_meta: | ||
"description": "Package management in Plone." | ||
"property=og:description": "Package management in Plone." | ||
"property=og:title": "Package management" | ||
"keywords": "Plone 6, package management, mxdev" | ||
--- | ||
|
||
# Package management | ||
|
||
Plone 6 consists of a collection of Python and Node.js packages. | ||
Over the decades of its existence, Plone has used several package management tools, sometimes multiple tools at one time. | ||
Each one has its strengths and weaknesses for performing specific tasks, such as installation, conflict resolution, updates and upgrades, and working with virtual environments and across platforms. | ||
|
||
With Volto as the default frontend in Plone 6, first npm, then pnpm, was brought into the mix as a package manager for its Node.js packages. | ||
|
||
Python itself has a complex and convoluted history with package management, as [xkcd](https://xkcd.com/1987/) illustrates. | ||
|
||
```{image} /_static/conceptual-guides/xkcd-1987-python-environment.png | ||
:alt: A comic from xkcd entitled Python Environment | ||
:class: figure | ||
:target: https://xkcd.com/1987/ | ||
``` | ||
|
||
|
||
(manage-backend-python-packages-label)= | ||
|
||
## Manage backend Python packages | ||
|
||
If you want to check out a Plone core package for development, or want to override the constraints of Plone, normally you would define constraints with a file {file}`constraints.txt` to tell `pip` to install a different version of a Plone package. | ||
|
||
```text | ||
# constraints.txt with unresolvable version conflict | ||
-c https://dist.plone.org/release/{PLONE_BACKEND_PATCH_VERSION}/constraints.txt | ||
plone.api>=2.0.0a3 | ||
``` | ||
|
||
Unfortunately `pip` does not allow overriding constraints this way. | ||
{term}`mxdev` solves this issue. | ||
|
||
|
||
### `mxdev` to the rescue! | ||
|
||
`mxdev` resolves Plone constraints according to your needs for pinning versions or source checkouts. | ||
It reads its configuration file {file}`mx.ini`, and your {file}`requirements.txt` and {file}`constraints.txt` files. | ||
Then it fetches the requirements and constraints of Plone. | ||
Finally, it writes new combined requirements in {file}`requirements-mxdev.txt` and new constraints in {file}`constraints-mxdev.txt`. | ||
Together these two files contain the combined requirements and constraints, but modified according to the configuration in {file}`mx.ini`. | ||
The generated files indicate from where the constraints were fetched, and comments are added when a modification was necessary. | ||
|
||
`mxdev` does not run `pip` or install packages. | ||
You or your development tools, such as GNU Make, must perform that step. | ||
|
||
```{seealso} | ||
{doc}`/manage/backend` | ||
``` | ||
|
||
|
||
## Manage frontend Node.js packages | ||
|
||
```{todo} | ||
Why do we use pnpm? | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
myst: | ||
html_meta: | ||
"description": "Manage Plone frontend" | ||
"property=og:description": "Manage Plone frontend" | ||
"property=og:title": "Manage Plone frontend" | ||
"keywords": "Plone 6, manage, frontend, add-ons, packages" | ||
--- | ||
|
||
(manage-plone-frontend-label)= | ||
|
||
# Manage Plone frontend | ||
|
||
This part of the documentation describes how to perform common management tasks in the Plone frontend. | ||
|
||
```{seealso} | ||
{doc}`/volto/addons/index` | ||
``` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the future it might make sense to split this into "configure the Plone backend" and "manage add-ons" chapters. But that can happen later, when we add more material.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
I assume "add-ons" would retain the same content.
I assume "configure" would be a new page and include a port of https://5.docs.plone.org/adapt-and-extend/config/index.html. I'm loathe to start on this, however, until we have automated screenshots. I have high hopes for every sprint, followed by disappointment. I need help to make this happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe. I was thinking of this as more the stuff you do outside of the Plone UI itself. It could be that too, but then we have to decide how to handle the Volto vs Classic divide for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, that makes sense. I'd prefer to wait until we have automated screenshots before starting on any web UI stuff anyway.
Can you provide examples of what should go into "configure"? Dexterity content types? Other?