Skip to content
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

#187 backport to 2.x #189

Merged
merged 2 commits into from
Nov 9, 2023
Merged

#187 backport to 2.x #189

merged 2 commits into from
Nov 9, 2023

Conversation

mamico
Copy link
Member

@mamico mamico commented Oct 6, 2023

As also reported in plone/Products.CMFPlone#3829 (comment) it might be useful to have fix #187 also for 2.x versions for Plone 5.2 users

@mister-roboto

This comment was marked as resolved.

@mamico
Copy link
Member Author

mamico commented Oct 6, 2023

@jenkins-plone-org please run jobs

@mamico mamico marked this pull request as draft October 6, 2023 22:33
@mamico mamico requested a review from gforcada October 7, 2023 13:08
mauritsvanrees added a commit to plone/plone.supermodel that referenced this pull request Nov 9, 2023
Backported from version 2.0.

This fixes test failures on Plone 5.2 Python 3 when used together with plone/plone.dexterity#189, which is a backport of a memory leak fix.
Failures are like this:

```
File "/home/jenkins/.buildout/eggs/cp38/plone.autoform-1.9.1-py3.8.egg/plone/autoform/tests/../autoform.rst", line 50, in autoform.rst
Failed example:
    xmlconfig.xmlconfig(StringIO(configuration))
Exception raised:
    Traceback (most recent call last):
      File "/srv/python3.8/lib/python3.8/doctest.py", line 1336, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest autoform.rst[11]>", line 1, in <module>
        xmlconfig.xmlconfig(StringIO(configuration))
      File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/xmlconfig.py", line 732, in xmlconfig
        context.execute_actions(testing=testing)
      File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/config.py", line 799, in execute_actions
        reraise(
      File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/_compat.py", line 31, in reraise
        raise value.with_traceback(tb)
      File "/home/jenkins/.buildout/eggs/cp38/zope.configuration-4.4.1-py3.8.egg/zope/configuration/config.py", line 791, in execute_actions
        callable(*args, **kw)
      File "/home/jenkins/.buildout/eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/model.py", line 116, in finalizeSchemas
        for schema in sorted(schemas):
    zope.configuration.config.ConfigurationExecutionError: File "/home/jenkins/.buildout/eggs/cp38/plone.supermodel-1.6.5-py3.8.egg/plone/supermodel/configure.zcml", line 9.4-12.10
          <zcml:customAction
              handler=".model.finalizeSchemas"
              order="9999999"
              />

        TypeError: '<' not supported between instances of 'Provides' and 'InterfaceClass'
```

The test failures are mostly in `plone.autoform` and in `plone.app.registry`, but strangely you do not get the error when you run only the tests for one of those packages.
You really need to run the entire Plone test suite (`bin/test` in coredev, without options).  So there is likely some test leakage.

Python 2 does not have this problem: sorting on Python 3 is handled differently.
On Python 2:

```
>>> from zope.interface.declarations import Implements, Provides
>>> sorted([Implements(), Provides(object)])
[classImplements(?), directlyProvides(object)]
```

On Python 3:

```
>>> from zope.interface.declarations import Implements, Provides
>>> sorted([Implements(), Provides(object)])
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: '<' not supported between instances of 'Provides' and 'Implements'
```
@mauritsvanrees mauritsvanrees marked this pull request as ready for review November 9, 2023 14:03
@mauritsvanrees
Copy link
Member

There are lots of test failures on Python 3. Those should be fixed together with plone/plone.supermodel#55.

I am testing these two PRs together on Jenkins now.

@mauritsvanrees
Copy link
Member

If Jenkins is green, then an open question is whether we dare to still put those two in a Plone 5.2 release, or if we keep this in a not-yet-existing list of package versions that you can switch to if you know what you are doing.
Note that 5.2 is officially out of maintenance support.

@mamico
Copy link
Member Author

mamico commented Nov 9, 2023

There are lots of test failures on Python 3.

That was the reason I changed this PR to draft. Thank you for carrying on.

@gforcada
Copy link
Member

gforcada commented Nov 9, 2023

IMHO we could cut new individual distribution releases but not compile a new Plone 5.2.x release, just as @mauritsvanrees suggests: if you know what you are doing, the release is there for you to easily use it, otherwise, please move to 6.x where the fix is also applied 😄

mauritsvanrees added a commit to plone/buildout.coredev that referenced this pull request Nov 9, 2023
Their 2.x and 1.x branches are getting some changes that *should* be fine, but feel slightly too adventurous for official inclusion in 5.2, if we ever do a new release.
See plone/plone.dexterity#189 (comment)
@mauritsvanrees
Copy link
Member

Okay, I have changed the coredev 5.2 sources.cfg to use new branches: plone.dexterity 2.10.x and plone.supermodel 1.6.x.
Now I will merge the two PRs and they won't end up officially in 5.2.

@mauritsvanrees mauritsvanrees merged commit 5a62712 into 2.x Nov 9, 2023
@mauritsvanrees mauritsvanrees deleted the 186_backport branch November 9, 2023 23:58
@mauritsvanrees
Copy link
Member

I have made releases:

plone.supermodel = 1.7.0
plone.dexterity = 2.11.0

@mauritsvanrees
Copy link
Member

I propose to add a newer-versions.cfg in coredev 5.2, that includes these versions.
See plone/buildout.coredev#899.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants