Ticket #12193 (closed PLIP: fixed)

Opened 5 years ago

Last modified 4 years ago

Officially support Python 2.7

Reported by: hannosch Owned by: runyaga
Priority: major Milestone: 4.2
Component: General Version: 4.2
Keywords: Cc:

Description (last modified by smcmahon) (diff)

Proposer: Hanno Schlichting
Seconder: Steve McMahon

Motivation

Python 2.7 is the only maintained Python 2.x release and has a long term support status. As upgrading to Python 3.x is not feasible in the foreseeable future, we should at least update to the latest Python 2.x version.

For example Python 2.7.3 is the first release that will support the Linux 3 kernel, Python 2.6.x releases won't support this at all. Python 2.7 is also the first release to support the upcoming Subversion 1.7 release. In general being on the latest actively supported version is a good idea ;)

Assumptions

With Plone 4.1 we updated to Zope 2.13 which does support Python 2.7 already. So the only thing left to do is to make sure CMF and Plone itself work with it. There's been a number of reports of people successfully running Plone 4.1 on Python 2.7 so there doesn't seem to be a any major problems. Python 2.6 has better availability on various Linux distributions - especially their long term support flavors, so it's desirable to keep support for it.

Proposal & Implementation

For the next Plone version we should officially support Python 2.6 and 2.7. All installers that build or install their own Python version should be updated to use Python 2.7, as this gives us better install support on modern operating systems.

The default test runs for coredev should be changed to Python 2.7 and this Python version should be advertised as the default version to use. In order to ensure ongoing compatibility with Python 2.6 we need separate test runs for Python 2.6.

Python 2.6 support might be phased out at some point, at the latest in October 2013 when security support for the Python 2.6 series ends. If there's advantages to simplify porting to Python 3.x, it might be phased out earlier, taking into account availability of Python 2.7 in major OS distributions.

Deliverables

All Plone tests need to pass under both Python 2.6 and 2.7. The installers need to be updated to use Python 2.7 by default. Jenkins test runs for both Python 2.6 and 2.7 need to be in place.

Risks

Python 2.7 introduces some minor changes to its C API. None of the changes are in frequently used methods and it's unlikely any Plone add-ons depend on these. The other porting changes all look unproblematic ( http://docs.python.org/dev/whatsnew/2.7.html#porting-to-python-2-7).

There's a risk of people using new Python 2.7 features and breaking Python 2.6 compatibility. For the core we should catch those by running the tests under Python 2.6. For add-ons it will be up to the add-ons authors to decide what Python versions they want to support.

Participants

Hanno Schlichting hopefully Steve McInstaller and Enfold ;)

Progress

A separate test run of the core is set up at  https://jenkins.plone.org/job/Plone_4.2_Python_27_Tests/ - it currently fails on a version conflict with a too old distribute version installed on the OS level.

Change History

comment:1 Changed 5 years ago by smcmahon

  • Description modified (diff)

comment:2 Changed 4 years ago by hannosch

  • Status changed from new to assigned
  • Owner set to hannosch
  • Milestone set to 4.3

We have continuos test runs for a while now. I fixed them to account for the Github move. I fixed most of the problems (unimportant changes in the output of the diff library). Last test runs shows two test failures ( https://jenkins.plone.org/job/Plone_4.2_Python_27_Tests/84/testReport/)

The tests failure in testUnicodeSplitter is locale and machine dependent and the tests pass on my machine. The test failures in test_popup_items might not be Python 2.7 related - but without working tests for the 4.2 coredev baseline it's hard to say.

I think the non-installer related tasks are almost complete. If Steve or Enfold want to start working on the installers, that would be great. If there's questions I can certainly help.

comment:3 Changed 4 years ago by mj

The framework team has accepted this PLIP for inclusion into 4.3, and I've volunteered to be the FWT champion. That means you can bug me if you need feedback from the team.

Go forth and implement! :-)

comment:4 Changed 4 years ago by kleist

I've created a Trac report for Python 2.7 related bugs (having the keyword "python27"): https://dev.plone.org/report/60

comment:5 Changed 4 years ago by mj

Do you guys think you can have this ready by the first week of January for reviewing by the FWT? That's the date we are setting for inclusion into Plone 4.3.

comment:6 Changed 4 years ago by smcmahon

Installer updates will be done a bit later. I assume the FWT doesn't need to see those to move forward?

comment:7 Changed 4 years ago by eleddy

I hear there are two bugs remaining on this. We would love to get this wrapped up and merged first. Do you think it's ready for this?

comment:8 Changed 4 years ago by davisagli

I fixed the outstanding failures so the Python 2.7 build is now green!  https://jenkins.plone.org/view/Plone%20Core/view/Plone%204.2/job/Plone_4.2_Python_27_Tests/

comment:9 Changed 4 years ago by hannosch

  • Status changed from assigned to new
  • Owner changed from hannosch to davisagli
  • Version set to 4.1
  • severity set to Untriaged

David was kind enough to take over this PLIP from me.

comment:10 Changed 4 years ago by smcmahon

The Unified and OS X Installers for 4.2 are now using Python 2.7.

comment:11 Changed 4 years ago by esteele

  • Status changed from new to closed
  • Version changed from 4.1 to 4.2
  • Resolution set to fixed
  • Milestone changed from 4.3 to 4.2

Merged for Plone 4.2. Thanks!

comment:12 Changed 4 years ago by davisagli

  • Component changed from Infrastructure to General

comment:13 Changed 4 years ago by nickb

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:14 Changed 4 years ago by nickb

Requesting this re-opened as it seems only partially implemented. The Windows installer for Plone 4.2 includes Python 2.6 only (contrary to the Plone 4.2 release notes).

Personally I've been scratching my head why ElementTree queries that worked elsewhere were not running under Windows Plone 4.2. Then I find out the Windows installer is not aligned to the Unified Installer and XPath support was only introduced to Python ElementTree in Python 2.7.

Why would the platforms be split like this with the core runtime - it's just asking for problems...

comment:15 Changed 4 years ago by smcmahon

  • Owner changed from davisagli to runyaga

comment:16 Changed 4 years ago by esteele

  • Status changed from reopened to closed
  • Resolution set to fixed

I've spoken with runyaga last month about the Windows installer and he's working on getting it running with Python 2.7. Expect to see it in one of the next 4.2.x releases.

If this does need a ticket, I'd rather it have its own instead of reopening the PLIP.

Note: See TracTickets for help on using tickets.