From e198c62a4b4a550e4b13f8259f17088cb0eb8602 Mon Sep 17 00:00:00 2001 From: mauritsvanrees Date: Fri, 26 Feb 2016 13:57:52 +0100 Subject: [PATCH] [fc] Repository: plone.app.robotframework Branch: refs/heads/master Date: 2016-02-25T23:57:18+01:00 Author: Maurits van Rees (mauritsvanrees) Commit: https://github.com/plone/plone.app.robotframework/commit/117f780e81a642673a24e67478e792f538e5e10e Do not require argparse, decorator, and simplejson in Python 2.7. Only lower. Files changed: M CHANGES.txt M setup.py Repository: plone.app.robotframework Branch: refs/heads/master Date: 2016-02-26T13:57:52+01:00 Author: Maurits van Rees (mauritsvanrees) Commit: https://github.com/plone/plone.app.robotframework/commit/0cfabf9b4b18ce52a0463a4511cf3381b13fcd22 Merge pull request #53 from plone/cleanup-requires-27 Do not require argparse, decorator, and simplejson in Python 2.7. Files changed: M CHANGES.txt M setup.py --- last_commit.txt | 223 ++++++++++++++++++++++++++++-------------------- 1 file changed, 131 insertions(+), 92 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index e11cae6543..ca2fbef167 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -1,123 +1,162 @@ -Repository: plone.contentrules +Repository: plone.app.robotframework Branch: refs/heads/master -Date: 2016-02-09T23:00:12+01:00 -Author: Gil Forcada (gforcada) -Commit: https://github.com/plone/plone.contentrules/commit/dac1655b1f497452e0a92d40f36fc6e12d884989 - -Fix a write on read situation +Date: 2016-02-25T23:57:18+01:00 +Author: Maurits van Rees (mauritsvanrees) +Commit: https://github.com/plone/plone.app.robotframework/commit/117f780e81a642673a24e67478e792f538e5e10e -If the context gets its first annotation it need to be marked as -safe to write. +Do not require argparse, decorator, and simplejson in Python 2.7. -The same goes for the annotations on the object. +Only lower. Files changed: -M CHANGES.rst -M plone/contentrules/engine/assignments.py - -diff --git a/CHANGES.rst b/CHANGES.rst -index 4b8d987..e2e3c25 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -12,6 +12,8 @@ Fixes: +M CHANGES.txt +M setup.py + +diff --git a/CHANGES.txt b/CHANGES.txt +index ba785e2..c5c720a 100644 +--- a/CHANGES.txt ++++ b/CHANGES.txt +@@ -4,9 +4,14 @@ Changelog + 0.9.15 (unreleased) + ------------------- - - *add item here* ++Fixes: ++ ++- Do not require argparse, decorator, and simplejson in Python 2.7, ++ only lower. [maurits] ++ + - Replace import of ``zope.testing.testrunner`` with ``zope.testrunner``. + [thet] +- ++ -+- CSRF fix: safe write on read. -+ [gforcada] + 0.9.14 (2015-10-11) + ------------------- +diff --git a/setup.py b/setup.py +index 0bb1daa..b2f7511 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,5 +1,6 @@ + from setuptools import setup + from setuptools import find_packages ++import sys - 2.0.4 (2014-01-27) - ------------------ -diff --git a/plone/contentrules/engine/assignments.py b/plone/contentrules/engine/assignments.py -index 7918fca..b316a7c 100644 ---- a/plone/contentrules/engine/assignments.py -+++ b/plone/contentrules/engine/assignments.py -@@ -16,6 +16,12 @@ + version = '0.9.15.dev0' - from BTrees.OOBTree import OOBTree +@@ -43,9 +44,7 @@ def indent(line): + 'Products.MailHost', + 'Products.PlonePAS', + 'Products.PluggableAuthService', +- 'argparse', + 'babel', +- 'decorator', # required by r.selenium2library on Python 2.6.x + 'five.globalrequest', + 'plone.app.testing', + 'plone.testing', +@@ -55,7 +54,6 @@ def indent(line): + 'robotsuite', # not a direct dependency, but required for convenience + 'selenium', + 'setuptools', +- 'simplejson', # required for SauceLabs-keywords on Python 2.6.x + 'zope.component', + 'zope.configuration', + 'zope.i18n', +@@ -63,6 +61,13 @@ def indent(line): + 'zope.testrunner', + ] -+try: -+ from plone.protect.auto import safeWrite -+except ImportError: -+ def safeWrite(*args): -+ pass ++if sys.version_info < (2, 7): ++ install_requires.extend([ ++ 'argparse', ++ 'decorator', # required by r.selenium2library on Python 2.6.x ++ 'simplejson', # required for SauceLabs-keywords on Python 2.6.x ++ ]) + - - def check_rules_with_dotted_name_moved(rule): - """Migrate on-the-fly added event dotted name -@@ -85,6 +91,10 @@ def ruleAssignmentManagerAdapterFactory(context): - annotations = IAnnotations(context) - manager = annotations.get(KEY, None) - if manager is None: -- manager = annotations[KEY] = RuleAssignmentManager() -+ annotations[KEY] = RuleAssignmentManager() -+ manager = annotations[KEY] -+ # protect both context and its annotations from a write on read error -+ safeWrite(context) -+ safeWrite(context.__annotations__) - - return manager + test_requires = [ + 'plone.app.dexterity', + 'plone.app.textfield', -Repository: plone.contentrules +Repository: plone.app.robotframework Branch: refs/heads/master -Date: 2016-02-25T13:33:55+01:00 +Date: 2016-02-26T13:57:52+01:00 Author: Maurits van Rees (mauritsvanrees) -Commit: https://github.com/plone/plone.contentrules/commit/5abe5c1c9c36f6a179d82d1dfb96fb3a528d1039 +Commit: https://github.com/plone/plone.app.robotframework/commit/0cfabf9b4b18ce52a0463a4511cf3381b13fcd22 -Merge pull request #4 from plone/write-on-read +Merge pull request #53 from plone/cleanup-requires-27 -Fix a write on read situation +Do not require argparse, decorator, and simplejson in Python 2.7. Files changed: -M CHANGES.rst -M plone/contentrules/engine/assignments.py - -diff --git a/CHANGES.rst b/CHANGES.rst -index 4b8d987..e2e3c25 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -12,6 +12,8 @@ Fixes: +M CHANGES.txt +M setup.py + +diff --git a/CHANGES.txt b/CHANGES.txt +index ba785e2..c5c720a 100644 +--- a/CHANGES.txt ++++ b/CHANGES.txt +@@ -4,9 +4,14 @@ Changelog + 0.9.15 (unreleased) + ------------------- - - *add item here* ++Fixes: ++ ++- Do not require argparse, decorator, and simplejson in Python 2.7, ++ only lower. [maurits] ++ + - Replace import of ``zope.testing.testrunner`` with ``zope.testrunner``. + [thet] +- ++ -+- CSRF fix: safe write on read. -+ [gforcada] + 0.9.14 (2015-10-11) + ------------------- +diff --git a/setup.py b/setup.py +index 0bb1daa..b2f7511 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,5 +1,6 @@ + from setuptools import setup + from setuptools import find_packages ++import sys - 2.0.4 (2014-01-27) - ------------------ -diff --git a/plone/contentrules/engine/assignments.py b/plone/contentrules/engine/assignments.py -index 7918fca..b316a7c 100644 ---- a/plone/contentrules/engine/assignments.py -+++ b/plone/contentrules/engine/assignments.py -@@ -16,6 +16,12 @@ + version = '0.9.15.dev0' - from BTrees.OOBTree import OOBTree +@@ -43,9 +44,7 @@ def indent(line): + 'Products.MailHost', + 'Products.PlonePAS', + 'Products.PluggableAuthService', +- 'argparse', + 'babel', +- 'decorator', # required by r.selenium2library on Python 2.6.x + 'five.globalrequest', + 'plone.app.testing', + 'plone.testing', +@@ -55,7 +54,6 @@ def indent(line): + 'robotsuite', # not a direct dependency, but required for convenience + 'selenium', + 'setuptools', +- 'simplejson', # required for SauceLabs-keywords on Python 2.6.x + 'zope.component', + 'zope.configuration', + 'zope.i18n', +@@ -63,6 +61,13 @@ def indent(line): + 'zope.testrunner', + ] -+try: -+ from plone.protect.auto import safeWrite -+except ImportError: -+ def safeWrite(*args): -+ pass ++if sys.version_info < (2, 7): ++ install_requires.extend([ ++ 'argparse', ++ 'decorator', # required by r.selenium2library on Python 2.6.x ++ 'simplejson', # required for SauceLabs-keywords on Python 2.6.x ++ ]) + - - def check_rules_with_dotted_name_moved(rule): - """Migrate on-the-fly added event dotted name -@@ -85,6 +91,10 @@ def ruleAssignmentManagerAdapterFactory(context): - annotations = IAnnotations(context) - manager = annotations.get(KEY, None) - if manager is None: -- manager = annotations[KEY] = RuleAssignmentManager() -+ annotations[KEY] = RuleAssignmentManager() -+ manager = annotations[KEY] -+ # protect both context and its annotations from a write on read error -+ safeWrite(context) -+ safeWrite(context.__annotations__) - - return manager + test_requires = [ + 'plone.app.dexterity', + 'plone.app.textfield',