Skip to content

Latest commit

 

History

History
91 lines (57 loc) · 2.73 KB

P8_UPGRADE_GUIDE.md

File metadata and controls

91 lines (57 loc) · 2.73 KB

P8: Plone 5 + Python 3 Upgrade Guide

This document is inteded to give a rough plan how to achieve an upgrade of SENAITE to the latest Plone 5 codebase in combination with Python 3. Therfore, it is named P8.

Why Python 3?

The current codebase of SENAITE is only compatible with Plone 4 and Python 2.x. Python stops support for the 2.x series by January 2020.

How to achieve it?

SENAITE needs to be first compatible with Plone 5 in combination with Python 2. It need then to be checked if the Archetypes framework is compatible with Python 3 or not.

It need then to be considered to migrate existing content types to the new Dexterity or stick to Archetypes and try to make this framework compatible to Python 3.

Especially the compatibility with customer addons and the migration of all the Archetypes based fields need to be considered in this step.

Roadmap

This roadmap outlines the most important steps of the upgrade process in a logical order:

  1. Accomplish to upgrade to Plone 5
  2. Make the codebase Python 2/3 compatible with six
  3. Upgrade non-complex content types to Dexterity, e.g. controlpanel folders
  4. Upgrade JavaScript libraries, especially compatibility with the latest jQuery library
  5. Upgrade Archetypes fields to z3c.form fields
  6. Upgrade non-complex fields to Dexterity
  7. Upgrade to Python 3

Python 2/3 compatibility

This section lists the most importatnt snippets how to use the six library already today in the SENAITE codebase to prepare the code for Python 3 compatibility.

This section is inteded to grow on the way

Check if the object is a string

https://six.readthedocs.io/#six.string_types

Before:

if isinstance(thing, basestring):
    ...

After:

import six

if isinstance(thing, six.string_types):
    ...

Support

Migrating the SENAITE Project to Plone 5 and Python 3 is a huge effort and cannot be achieved without the support of the community.

Please consider therefore to support us to keep SENAITE an open-source success story: https://community.senaite.org/t/how-can-senaite-be-maintained-open-source

Companies behind SENAITE