-
-
Notifications
You must be signed in to change notification settings - Fork 186
Create upgrade guide for Plone 6.2 backend. #2002
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
Open
mauritsvanrees
wants to merge
2
commits into
6.0
Choose a base branch
from
maurits-start-upgrade-guide-plone-62
base: 6.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+88
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -27,5 +27,6 @@ upgrade-to-python3 | |
| upgrade-zodb-to-python3 | ||
| upgrade-to-60 | ||
| upgrade-to-61 | ||
| upgrade-to-62 | ||
| migrate-to-volto | ||
| ``` | ||
85 changes: 85 additions & 0 deletions
85
docs/backend/upgrading/version-specific-migration/upgrade-to-62.md
This file contains hidden or 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,85 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| "description": "How to upgrade to Plone 6.2" | ||
| "property=og:description": "How to upgrade to Plone 6.2" | ||
| "property=og:title": "How to upgrade to Plone 6.2" | ||
| "keywords": "Upgrade, Plone 6" | ||
| --- | ||
|
|
||
| (backend-upgrade-plone-v62-label)= | ||
|
|
||
| # Upgrade Plone 6.1 to 6.2 | ||
|
|
||
| Plone 6.2 has seen the following major changes. | ||
| Some may require changes in your setup. | ||
|
|
||
|
|
||
| ## Move to native namespaces | ||
|
|
||
| Plone 6.2 has migrated all core Python packages from `pkg_resources`-style namespaces to native namespaces. | ||
|
|
||
| The Plone Python backend consists of over 200 packages. | ||
| Most of these are namespace packages. | ||
| Examples are `plone.batching` and `plone.api`, which share the `plone` namespace. | ||
|
|
||
| There are three styles or techniques of namespaces. | ||
| For Plone only two are important: `pkg_resources` and native (sometimes referred to as implicit). | ||
| The third style is `pkgutil`, but Plone has never used it. | ||
|
|
||
| Native namespaces exist since Python 3.3. | ||
| Because Plone started in the days of Python 2, it has always used `pkg_resources`. | ||
| `pkg_resources` is part of the `setuptools` package. | ||
| This part is deprecated. | ||
| It's scheduled to be removed around the end of 2025, in `setuptools` 81. | ||
| This means Plone needs to move to native namespaces. | ||
|
|
||
| In general, this move shouldn't cause problems for integrators. | ||
| To install Plone 6.2 you can keep using the same version of `pip` (or `uv`), or `zc.buildout` as you do for Plone 6.1. | ||
| This assumes that all packages within one namespace use the same namespace style or technique. | ||
|
|
||
| You may encounter problems when this assumption isn't true. | ||
| As an example, say your Plone project uses a package `collective.example`, and this still uses `pkg_resources`-style namespaces. | ||
| Plone itself depends on a package `collective.monkeypatcher` which is now using native namespaces. | ||
| This may cause problems at startup, especially `ModuleNotFoundError`. | ||
| In a normal install: | ||
|
|
||
| * `pip` works fine. | ||
| * `zc.buildout` 4 won't work. | ||
| * `zc.buildout` 5 works fine. | ||
|
|
||
| If for one or both of these packages you don't use a final release from https://pypi.org, but an editable install, it may not work. | ||
| You can solve this by installing an extra package with `pip`, `horse-with-no-namespace`. | ||
|
|
||
| ```{note} | ||
| If you let `zc.buildout` install `horse-with-no-namespace`, it won't work. | ||
| It really must be installed by `pip` into the same virtual environment where you have installed `zc.buildout`. | ||
| ``` | ||
|
|
||
| The recommendation is to migrate all namespace packages to native namespaces. | ||
| This includes the `collective` namespace that a lot of Plone add-ons use. | ||
| This {doc}`guide </developer-guide/native-namespace>` describes the needed steps. | ||
|
|
||
| ## Start separating Classic UI code from the core | ||
|
|
||
| In Plone 6, the Python backend includes the Classic UI frontend. | ||
| You can't get one without the other. | ||
| If you use the Volto frontend, this means that you get lots of code that you never use. | ||
|
|
||
| Plone 6.2 starts separating Classic UI code from the core of Plone. | ||
| This is ongoing work, described in {term}`PLIP` [3953](https://github.com/plone/Products.CMFPlone/issues/3953). | ||
| You won't yet get less code yet. | ||
| This PLIP is preparation for a more complete separation in Plone 7. | ||
|
|
||
| The focus currently is on moving page templates into the `plone.app.layout` package. | ||
| Templates from the following packages are now in a new location: | ||
|
|
||
| * `plone.locking` | ||
| * `plone.protect` | ||
|
|
||
| ```{note} | ||
| If you use the `z3c.jbot` add-on to override a template that has been moved, your override will still work. | ||
| This is because we keep a mapping from the old to the new location. | ||
| For example, `plone.locking` registers that `plone.locking.browser.info.pt` has a new location, `plone.app.layout.viewlets.locking.pt`. | ||
| You should rename your override to the new location if you no longer need compatibility with Plone 6.1 or earlier. | ||
| ``` | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ jQuery | |
| libxslt | ||
| middleware | ||
| Mockup | ||
| namespaces? | ||
| npm | ||
| nvm | ||
| Pastanaga | ||
|
|
||
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.
We should include references to the following terms.
If I read all that correctly, a native namespace is a subcategory of implicit namespaces. Is that right?
If so, then I'd make the following suggestion.
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.
@mauritsvanrees I committed all but this one suggestion, as I'd like your thoughts on 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.
This suggestion seems helpful to me.
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.
Adding the links is good.
But I don't see where you got the impression that native namespace are a subset of implicit namespaces. As far as I know, there is no difference, they are two terms for the exact same thing.
Your first link says: "Python 3.3 added implicit namespace packages from PEP 420. All that is required to create a native namespace package is that you just omit
__init__.pyfrom the namespace package directory." The text points to your second link, the official PEP, and the term "native" is not even mentioned there.I asked Duck.AI, but that answer was just clearly wrong, restricting native to namespaces that exist within one package and still have an
__init__.py, though empty.@davisagli Do you know a difference between the two?
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.
Yes, that's exactly why I was uncertain. I can ask in Python's doc Discord channel to see what they say, too.
Uh oh!
There was an error while loading. Please reload this page.
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 misread Steve's suggestion. Native namespace packages are not a subcategory of implicit namespaces. They are 2 synonyms for the same kind (which is defined in PEP 420). They are implicit because you don't have to explicitly declare them in
__init__.py, and they are native because they are built in to Python without installing an extra package like setuptools.