Skip to content

Commit d650a08

Browse files
Another revision of uv-managed branch (#2074)
* More uv managed revisions - The instructions for installation from PyPI have only two options, Cookieplone and Buildout, not the three options from the include. The attempt to avoid DRY with an include won't work here. * - DRY for complete the add-on installation * "mxdev" isn't an inline literal * "mxdev" isn't an inline literal * tighten up spacing * grammar * Increasing specificity * Make URL clickable * Add an introductory paragraph to the empty subheading * - Link to sections in add-ons documentation - spelling of mxdev and pip - Oxford comma * Fix Vale errors * Fix Vale errors * Remove unnecessary section subheading * Promote uv as the first package manager, and combine its first two sentences. * MyST markup, grammar, link to the pip interface for uv * Update docs/conceptual-guides/package-management.md * Update docs/admin-guide/override-core.md Co-authored-by: David Glick <david@glicksoftware.com> --------- Co-authored-by: David Glick <david@glicksoftware.com>
1 parent 4dd55dd commit d650a08

5 files changed

Lines changed: 74 additions & 51 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
In your web browser, and assuming you are currently logged in as an administrator, visit the URL http://localhost:8080/Plone/prefs_install_products_form.
2+
3+
Then click the {guilabel}`Install` button next to your add-on to complete installation of the add-on.
4+
5+
Some add-ons have configuration options.
6+
To configure such add-ons, return to the {guilabel}`Site Setup` control panel.
7+
At the bottom of the page, you should see the heading {guilabel}`Add-on Configuration`, and a control panel to configure the add-on that you just installed.

docs/admin-guide/add-ons.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,39 @@ You can control which version of an add-on to install through "version pinning."
9898

9999
### Install the add-on
100100

101-
```{include} /_inc/_build-and-restart.md
101+
If the backend is running, stop it with {kbd}`ctrl-c`.
102+
103+
To actually download and install the new add-on, run the following command.
104+
105+
`````{tab-set}
106+
````{tab-item} Cookieplone
107+
:sync: cookieplone
108+
109+
```shell
110+
make backend-build
111+
```
112+
````
113+
114+
````{tab-item} Buildout
115+
:sync: buildout
116+
117+
```shell
118+
bin/buildout -N
102119
```
120+
````
121+
`````
122+
123+
Next, restart the backend.
103124

104-
In your web browser, and assuming you are currently logged in as an administrator, visit the URL http://localhost:8080/Plone/prefs_install_products_form.
125+
```{seealso}
126+
{doc}`run-plone`
127+
```
105128

106-
Then click the {guilabel}`Install` button next to your add-on to complete installation of the add-on.
129+
```{include} /_inc/_add-on-complete-install.md
130+
```
107131

108-
Some add-ons have configuration options.
109-
To configure such add-ons, return to the {guilabel}`Site Setup` control panel.
110-
At the bottom of the page, you should see the heading {guilabel}`Add-on Configuration`, and a control panel to configure the add-on that you just installed.
111132

133+
(install-an-add-on-from-source-label)=
112134

113135
## Install an add-on from source
114136

@@ -190,7 +212,7 @@ extras=test
190212
191213
```{seealso}
192214
The {file}`mx.ini` file configures a tool called {term}`mxdev`.
193-
For an explanation of why Plone uses `mxdev`, see {ref}`manage-packages-mxdev-label`.
215+
For an explanation of why Plone uses mxdev, see {ref}`manage-packages-mxdev-label`.
194216
```
195217
````
196218
@@ -243,10 +265,5 @@ This way you always get the version that's currently available in the source con
243265
```{include} /_inc/_build-and-restart.md
244266
```
245267

246-
In your web browser, and assuming you are currently logged in as an administrator, visit the URL http://localhost:8080/Plone/prefs_install_products_form.
247-
248-
Then click the {guilabel}`Install` button next to your add-on to complete installation of the add-on.
249-
250-
Some add-ons have configuration options.
251-
To configure such add-ons, return to the {guilabel}`Site Setup` control panel.
252-
At the bottom of the page, you should see the heading {guilabel}`Add-on Configuration`, and a control panel to configure the add-on that you just installed.
268+
```{include} /_inc/_add-on-complete-install.md
269+
```

docs/admin-guide/override-core.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Sometimes you will need to override one or more package versions to fix a bug.
1616

1717
## Override the version of a core Plone package
1818

19-
The Python packages which are dependencies of Plone are pinned to specific versions at the time a Plone release is created.
19+
Plone's Python package dependencies are pinned to specific versions at the time a Plone release is created.
2020
This section describes how to override the version of one of these packages, in case you need a newer one.
2121

2222
```{caution}
23-
By doing this, you are intentionally using a combination of package versions that has not been tested by the Plone development team.
23+
When you override package versions, the combination of packages isn't tested by the Plone development team.
2424
Use at your own risk!
2525
```
2626

@@ -37,11 +37,10 @@ For projects created with Cookieplone, select the tab labeled:
3737
```
3838

3939
`````{tab-set}
40-
4140
````{tab-item} uv
4241
:sync: uv
4342
44-
Edit `constraint-dependencies` in the file {file}`pyproject.toml`.
43+
In the file {file}`pyproject.toml`, under the table `[tool.uv]`, edit `constraint-dependencies`.
4544
This example uses `plone.api`.
4645
4746
```
@@ -50,13 +49,12 @@ constraint-dependencies = [
5049
"plone.api==2.0.0a3",
5150
]
5251
```
53-
5452
````
5553
5654
````{tab-item} pip
5755
:sync: pip
5856
59-
Add a version override to the file {file}`backend/mx.ini`.
57+
In the file {file}`backend/mx.ini`, under the `[settings]` section, add `version-overrides` setting.
6058
This example uses `plone.api`.
6159
6260
```
@@ -67,9 +65,8 @@ version-overrides =
6765
6866
```{seealso}
6967
The {file}`mx.ini` file configures a tool called {term}`mxdev`.
70-
For an explanation of why Plone uses `mxdev`, see {ref}`manage-packages-mxdev-label`.
68+
For an explanation of why Plone uses mxdev, see {ref}`manage-packages-mxdev-label`.
7169
```
72-
7370
````
7471
7572
````{tab-item} Buildout
@@ -98,11 +95,9 @@ plone.api = 2.0.0a3
9895
```
9996
10097
```{note}
101-
The version pins specified in the `[versions]` section will take precedence over the pins inherited from `https://dist.plone.org/release/6-latest/versions.cfg`.
98+
The version pins specified in the `[versions]` section will take precedence over the pins inherited from https://dist.plone.org/release/6-latest/versions.cfg.
10299
```
103-
104100
````
105-
106101
`````
107102

108103
### Install the package
@@ -128,7 +123,6 @@ For projects created with Cookieplone, select the tab labeled:
128123
```
129124

130125
`````{tab-set}
131-
132126
````{tab-item} uv
133127
:sync: uv
134128
@@ -146,7 +140,6 @@ Add the local directory to your uv project as an editable package.
146140
cd backend
147141
uv add --editable ../plone.restapi
148142
```
149-
150143
````
151144
152145
````{tab-item} pip
@@ -164,9 +157,8 @@ extras = test
164157
165158
```{seealso}
166159
The {file}`mx.ini` file configures a tool called {term}`mxdev`.
167-
For an explanation of why Plone uses `mxdev`, see {ref}`manage-packages-mxdev-label`.
160+
For an explanation of why Plone uses mxdev, see {ref}`manage-packages-mxdev-label`.
168161
```
169-
170162
````
171163
172164
````{tab-item} Buildout
@@ -207,9 +199,7 @@ Setting an empty version ensures that the copy of `plone.restapi` from source co
207199
```{seealso}
208200
This approach uses the [`mr.developer`](https://pypi.org/project/mr.developer/) Buildout extension.
209201
```
210-
211202
````
212-
213203
`````
214204

215205
### Install the package

docs/conceptual-guides/package-management.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ myst:
1111

1212
Plone 6 consists of a collection of Python and Node.js packages.
1313
Over the decades of its existence, Plone has used several package management tools, sometimes multiple tools at one time.
14-
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.
14+
Each one has its strengths and weaknesses for performing specific tasks, such as installation, conflict resolution, updates, upgrades, and working with virtual environments and across platforms.
1515

1616
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.
1717

@@ -26,6 +26,21 @@ Python itself has a complex and convoluted history with package management, as [
2626

2727
## Manage backend Python packages
2828

29+
uv, pip with mxdev, and buildout are supported tools to manage the Python packages in the Plone backend.
30+
The following sections explain each of these tools in more detail.
31+
32+
33+
### uv
34+
35+
{term}`uv` is a package manager which is popular for its speed, its ability to manage the installation of Python itself, and its ability to consistently reproduce installed packages using a {file}`uv.lock` file.
36+
37+
When a project is fully managed using uv, it is configured in its {file}`pyproject.toml` file, and its packages are installed using `uv sync`.
38+
39+
uv also has a [pip interface](https://docs.astral.sh/uv/pip/), and installs packages into a virtual environment via the command `uv pip install`.
40+
41+
If you create a Plone project using Cookieplone, it creates a backend managed by uv.
42+
43+
2944
### pip
3045

3146
By convention in the Python community, {term}`pip` is commonly used to install Python packages.
@@ -49,37 +64,26 @@ As a best practice, pip should always be used inside a specific Python {term}`vi
4964

5065
During development, it is sometimes necessary to override the Plone version constraints.
5166
This makes it possible to:
52-
- install a newer version of a core Plone package that was released with a bugfix
53-
- install an unreleased core Plone package from a source control system
67+
- {ref}`install a newer version of a core Plone package that was released to PyPI <install-an-add-on-from-pypi-label>` with a bugfix
68+
- {ref}`install an unreleased core Plone package from a source control system <install-an-add-on-from-source-label>`
5469

55-
Unfortunately pip does not allow overriding constraints this way.
70+
pip does not allow overriding constraints this way.
5671
{term}`mxdev` solves this issue.
5772

58-
`mxdev` resolves Plone constraints according to your needs for pinning versions or source checkouts.
73+
mxdev resolves Plone constraints according to your needs for pinning versions or source checkouts.
5974
It reads its configuration file {file}`mx.ini`, and your {file}`requirements.txt` and {file}`constraints.txt` files.
6075
Then it fetches the requirements and constraints of Plone.
6176
Finally, it writes new combined requirements in {file}`requirements-mxdev.txt` and new constraints in {file}`constraints-mxdev.txt`.
6277
Together these two files contain the combined requirements and constraints, but modified according to the configuration in {file}`mx.ini`.
6378
The generated files indicate from where the constraints were fetched, and comments are added when a modification was necessary.
6479

65-
`mxdev` does not run `pip` or install packages.
80+
mxdev does not run pip or install packages.
6681
You or your development tools, such as GNU Make, must perform that step.
6782

6883
```{seealso}
6984
{doc}`/admin-guide/add-ons`
7085
```
7186

72-
### uv
73-
74-
More recently, {term}`uv` has become popular as a way to install Python packages.
75-
This package manager is popular for its speed, its ability to manage the installation of Python itself, and its ability to consistently reproduce installed packages using a {file}`uv.lock` file.
76-
77-
When a project is fully managed using uv, it is configured in `pyproject.toml` and the packages are installed using `uv sync`.
78-
79-
uv also has a backwards-compatible mode which works more like pip, and installs packages into a virtual environment via the command `uv pip install`.
80-
81-
If you create a Plone project using Cookieplone, it creates a backend managed by uv.
82-
8387
### buildout
8488

8589
{term}`Buildout` is a tool for installing Python packages that has been used in the Plone community since about 2007, and is still preferred by some members of the community.
@@ -89,9 +93,8 @@ It not only installs packages, but can set up other things using an extensible s
8993
Buildout does not install Python packages into a virtual environment.
9094
Instead, it creates scripts that add the necessary packages to `sys.path` before running the script target.
9195

92-
## Manage frontend Node.js packages
9396

94-
### pnpm
97+
## Manage frontend Node.js packages
9598

9699
Plone uses {term}`pnpm` to install Node.js packages.
97100

styles/config/vocabularies/Plone/accept.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,28 @@ backport(ed|ing)
1010
Barceloneta
1111
[Bb]oolean
1212
bugfix
13-
buildout
13+
[Bb]uildout
1414
cacheable
1515
Classic UI
16+
CMSs
1617
CMSUI
1718
CommonJS
1819
Cookieplone
1920
doctest
2021
ETags?
22+
extranets
2123
[Ff]avicon
2224
folderish
2325
fieldset
2426
getter
27+
interoperate
2528
JavaScript
2629
[Jj]enkins
2730
jQuery
2831
libxslt
2932
middleware
3033
Mockup
34+
mxdev
3135
namespaces?
3236
npm
3337
nvm
@@ -39,6 +43,7 @@ PLIP(s)
3943
Plone
4044
plonecli
4145
pluggab(le|ility)
46+
pnpm
4247
[Pp]ortlets?
4348
prerendered
4449
programatically
@@ -67,4 +72,5 @@ Volto
6772
Vue
6873
webpack
6974
wireframe
75+
xkcd
7076
Zope

0 commit comments

Comments
 (0)