Override core Plone packages#

Plone includes a few hundred Python packages. Sometimes you will need to override one or more package versions to fix a bug.

Override the version of a core Plone package#

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

Caution

When you override package versions, the combination of packages isn't tested by the Plone development team. Use at your own risk!

Configure package installation#

First, configure your project according to the instructions in the tabbed interface below. Select the tab according to your Python package manager.

Tip

For projects created with Cookieplone, select the tab labeled:

  • pip if your project has the file backend/mx.ini

  • uv if your project doesn't have this file

In the file pyproject.toml, under the table [tool.uv], edit constraint-dependencies. This example uses plone.api.

[tool.uv]
constraint-dependencies = [
    "plone.api==2.0.0a3",
]

In the file backend/mx.ini, under the [settings] section, add version-overrides setting. This example uses plone.api.

[settings]
version-overrides =
    plone.api==2.0.0a3

See also

The mx.ini file configures a tool called mxdev. For an explanation of why Plone uses mxdev, see mxdev.

Update the file buildout.cfg. This example uses plone.api.

[buildout]
extends =
    https://dist.plone.org/release/6-latest/versions.cfg

parts =
    instance

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
    Plone

[versions]
plone.api = 2.0.0a3

Note

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.

Install the package#

If the backend is running, stop it with ctrl-c.

To actually download and install the package, run the following command.

make backend-build
make backend-build
bin/buildout -N

Next, restart the backend.

See also

Run Plone

Install a core Plone package from source#

A core Plone package can be installed from a source control system such as GitHub. This is useful for developing and testing changes in core Plone packages.

Configure package installation#

First, configure your project according to the instructions in the tabbed interface below. Select the tab according to your Python package manager.

Tip

For projects created with Cookieplone, select the tab labeled:

  • pip if your project has the file backend/mx.ini

  • uv if your project doesn't have this file

This example uses plone.restapi.

Clone the repository into a local directory.

git clone git@github.com:plone/plone.restapi.git

Add the local directory to your uv project as an editable package.

cd backend
uv add --editable ../plone.restapi

Add the Plone package you want to check out in the file backend/mx.ini. This example uses plone.restapi.

[plone.restapi]
url = git@github.com:plone/plone.restapi.git
branch = main
extras = test

See also

The mx.ini file configures a tool called mxdev. For an explanation of why Plone uses mxdev, see mxdev.

Update the file buildout.cfg. This example uses plone.restapi.

[buildout]
extends =
    https://dist.plone.org/release/6-latest/versions.cfg
extensions = mr.developer
auto-checkout =
    plone.restapi

parts =
    instance

[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs =
    Plone

[sources]
plone.restapi = git https://github.com/plone/plone.restapi.git

[versions]
plone.restapi =

Tip

Setting an empty version ensures that the copy of plone.restapi from source control will be used, instead of the version pin inherited from https://dist.plone.org/release/6-latest/versions.cfg.

See also

This approach uses the mr.developer Buildout extension.

Install the package#

If the backend is running, stop it with ctrl-c.

To actually download and install the package, run the following command.

make backend-build
make backend-build
bin/buildout -N

Next, restart the backend.

See also

Run Plone