[Zope-CMF] GenericSetup: Apply profile dependencies only once

yuppie y.2015 at wcm-solutions.de
Wed Sep 23 16:53:03 CEST 2015


Hi Maurits,

Maurits van Rees wrote:
> Adding 'purgeProfileVersions' is also on my wish list now, which is
> really simple:
> 
>     portal_setup._profile_upgrade_versions = {}
> 
> There were a few problems in Plone due to my change with the dependency
> strategies.  I found that those were caused by importing the base Plone
> profile (so no extension profile), so this ran in purge mode, which
> meant several settings of add-ons were overwritten.  Only a problem you
> really ever encounter in test code that tries to do to much.
> 
> Purging the profile versions from portal setup helped solve this.  And I
> would rather call an official method than accessing the private
> _profile_upgrade_versions from within Plone code.

if you run a base profile in purge mode, shouldn't that purge profile
versions automatically?

> But actually, it is not that bad I think.  When I look at the top level
> files at how many lines of them are to 'blame' on my pep8 change, I get
> this table.  Not sure if this gets across nice in email:
> 
> Filename    Blame    Lines    Percentage
> __init__.py    5    55    9%
> components.py    28    559    5%
> content.py    25    417    6%
> context.py    162    723    22%
> differ.py    64    196    33%
> events.py    0    55    0%
> exceptions.py    0    21    0%
> interfaces.py    63    847    7%
> metadata.py    20    77    26%
> permissions.py    0    16    0%
> registry.py    44    746    6%
> rolemap.py    44    219    20%
> testing.py    0    178    0%
> tool.py        105    1426    7%
> upgrade.py    14    274    5%
> utils.py    49    927    5%
> zcml.py        20    372    5%
> 
> So the file with the biggest percentage of lines changed, is differ.py
> with 33 percent.  We have context.py, metadata.py and rolemap.py between
> 20 and 26 percent.  The rest is below 10 percent.
> The biggest and most central one, tool.py, has 7 percent of its lines
> changed.
> 
> In the tests directory things are very different, given that there are
> about 5000 pep8 errors there.  git itself says for three files that it
> completely rewrote them:
> 
>  rewrite Products/GenericSetup/tests/test_differ.py (66%)
>  rewrite Products/GenericSetup/tests/test_registry.py (78%)
>  rewrite Products/GenericSetup/tests/test_rolemap.py (64%)
> 
> But I would say for the tests a 'git blame' is less needed.

Sorry, but I'm still not convinced.

I agree the negative effect is smaller in the tests. I would not object
if you make automated cleanups in tests before you modify them.


Cheers,

	Yuppie



More information about the Zope-CMF mailing list