Skip to content

Commit

Permalink
[fc] Repository: plone.recipe.zope2instance
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2018-11-29T11:22:53+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@7a66dd9

Add support for Python 3.7 while dropping official support for Python 3.5.

Files changed:
M .travis.yml
M CHANGES.rst
M README.rst
M setup.py
M tox.ini
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2018-11-29T11:23:07+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@73b4a7a

Clean up MANIFEST.

Files changed:
M MANIFEST.in
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2018-11-29T11:23:31+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@b3d2ca2

Zope 2 is no longer supported.

Files changed:
M README.rst
M setup.py
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2018-11-29T11:23:48+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@1fb1411

Update to current Zope release.

Files changed:
M tox.ini
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2018-11-29T11:24:01+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@a60651a

Clean up.

Files changed:
M setup.cfg
M setup.py
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2018-11-30T09:38:50+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@813651d

Merge pull request #63 from plone/py37

Add support for Python 3.7 while dropping support for Python 3.5.

Files changed:
M .travis.yml
M CHANGES.rst
M MANIFEST.in
M README.rst
M setup.cfg
M setup.py
M tox.ini
  • Loading branch information
icemac committed Nov 30, 2018
1 parent 2532e32 commit 8a7a4fd
Showing 1 changed file with 95 additions and 8 deletions.
103 changes: 95 additions & 8 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,104 @@
Repository: plone.app.z3cform
Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-29T15:01:09-08:00
Author: Ross Patterson (rpatterson) <me@rpatterson.net>
Commit: https://github.com/plone/plone.app.z3cform/commit/9be338a1916f85327934431a6fbe0193cab35ae6
Date: 2018-11-29T11:22:53+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/7a66dd943dac28675e8d4e98f3a3867f7ef40444

Add support for rendering &lt;optgroup&gt; elements from ITreeVocabulary
Add support for Python 3.7 while dropping official support for Python 3.5.

Files changed:
M .travis.yml
M CHANGES.rst
M plone/app/z3cform/tests/test_widgets.py
M plone/app/z3cform/widget.py
M README.rst
M setup.py
M tox.ini

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex b5ed55a..7d773cd 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -10,7 +10,9 @@ Breaking changes:\n \n New features:\n \n-- *add item here*\n+- Add support for rendering <optgroup> elements from\n+ zope.schema.interfaces.ITreeVocabulary hierarchical terms.\n+ [rpatterson]\n \n Bug fixes:\n \ndiff --git a/plone/app/z3cform/tests/test_widgets.py b/plone/app/z3cform/tests/test_widgets.py\nindex ee9cbd5..7aa8335 100644\n--- a/plone/app/z3cform/tests/test_widgets.py\n+++ b/plone/app/z3cform/tests/test_widgets.py\n@@ -38,6 +38,7 @@\n from zope.schema import Set\n from zope.schema import TextLine\n from zope.schema import Tuple\n+from zope.schema import vocabulary\n from zope.schema.interfaces import IVocabularyFactory\n from zope.schema.vocabulary import SimpleTerm\n from zope.schema.vocabulary import SimpleVocabulary\n@@ -758,6 +759,44 @@ def test_data_converter_handles_empty_value(self):\n field.missing_value,\n )\n \n+ def test_widget_optgroup(self):\n+ """\n+ If the widget vocabulary is a mapping <optgroup>\'s are rendered.\n+ """\n+ from z3c.form import term\n+ from plone.app.z3cform.widget import SelectWidget\n+ widget = SelectWidget(self.request)\n+ widget.field = Choice(vocabulary=vocabulary.TreeVocabulary.fromDict({\n+ (\'foo_group\', \'Foo Group\'): {\n+ (\'bar_group\', \'Bar Group\'): {},\n+ (\'qux_group\', \'Qux Group\'): {},\n+ },\n+ (\'corge_group\', \'Corge Group\'): {\n+ (\'grault_group\', \'Grault Group\'): {},\n+ (\'garply_group\', \'Garply Group\'): {},\n+ },\n+ }))\n+ # Usse term.CollectionTermsVocabulary to simulate a named vocabulary\n+ # factory lookup\n+ widget.terms = term.CollectionTermsVocabulary(\n+ context=None, request=self.request, form=None, field=None,\n+ widget=widget, vocabulary=widget.field.vocabulary)\n+ widget.updateTerms()\n+ html = widget.render()\n+ self.assertNotIn(\n+ \'<option value="foo_group">\', html,\n+ \'Top level vocab item rendered as <option...>\')\n+ self.assertIn(\n+ \'<optgroup label="Foo Group">\', html,\n+ \'Rendered select widget missing an <optgroup...>\')\n+\n+ base_args = widget._base_args()\n+ pattern_widget = widget._base(**base_args)\n+ items = pattern_widget.items\n+ self.assertIsInstance(\n+ items, dict,\n+ \'Wrong widget items type\')\n+\n \n class AjaxSelectWidgetTests(unittest.TestCase):\n \ndiff --git a/plone/app/z3cform/widget.py b/plone/app/z3cform/widget.py\nindex d28134c..0840285 100644\n--- a/plone/app/z3cform/widget.py\n+++ b/plone/app/z3cform/widget.py\n@@ -42,6 +42,7 @@\n from z3c.form.browser.select import SelectWidget as z3cform_SelectWidget\n from z3c.form.browser.text import TextWidget as z3cform_TextWidget\n from z3c.form.browser.widget import HTMLInputWidget\n+from z3c.form import interfaces as form_ifaces\n from z3c.form.interfaces import IEditForm\n from z3c.form.interfaces import IFieldWidget\n from z3c.form.interfaces import IForm\n@@ -57,6 +58,7 @@\n from zope.i18n import translate\n from zope.interface import implementer\n from zope.interface import implementer_only\n+from zope.schema import interfaces as schema_ifaces\n from zope.schema.interfaces import IBool\n from zope.schema.interfaces import IChoice\n from zope.schema.interfaces import ICollection\n@@ -65,6 +67,7 @@\n from zope.schema.vocabulary import SimpleVocabulary\n \n import json\n+import collections\n import six\n \n \n@@ -257,6 +260,27 @@ class SelectWidget(BaseWidget, z3cform_SelectWidget):\n orderable = False\n required = True\n \n+ @property\n+ def items(self):\n+ """\n+ Optionally handle ITreeVocabulary vocabs as dicts.\n+ """\n+ terms = self.terms\n+ if form_ifaces.ITerms.providedBy(terms):\n+ terms = terms.terms\n+\n+ if schema_ifaces.ITreeVocabulary.providedBy(terms):\n+ groups = collections.OrderedDict()\n+ for group_term, option_terms in terms.items():\n+ group_widget = type(self)(self.request)\n+ group_widget.terms = option_terms\n+ group_label = (\n+ group_term.title or group_term.value or group_term.token)\n+ groups[group_label] = super(SelectWidget, group_widget).items\n+ return groups\n+ else:\n+ return super(SelectWidget, self).items\n+\n def _base_args(self):\n """Method which will calculate _base class arguments.\n \n@@ -301,14 +325,25 @@ def _base_args(self):\n # support both here to avoid breaking on some z3c.form versions.\n # See https://github.com/zopefoundation/z3c.form/issues/44\n base_items = base_items()\n- items = []\n- for item in base_items:\n+\n+ def makeItem(item):\n+ """\n+ Gather the information needed by the widget for the given term.\n+ """\n if not isinstance(item[\'content\'], six.string_types):\n item[\'content\'] = translate(\n item[\'content\'],\n context=self.request,\n default=item[\'value\'])\n- items.append((item[\'value\'], item[\'content\']))\n+ return (item[\'value\'], item[\'content\'])\n+\n+ if isinstance(base_items, dict):\n+ items = collections.OrderedDict(\n+ (group_label, [\n+ makeItem(base_item) for base_item in group_options])\n+ for group_label, group_options in base_items.items())\n+ else:\n+ items = [makeItem(item) for item in base_items]\n args[\'items\'] = items\n \n return args\n'
b'diff --git a/.travis.yml b/.travis.yml\nindex ac482ce..6e68b0b 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -1,8 +1,9 @@\n language: python\n+dist: xenial\n python:\n - 2.7\n- - 3.5\n - 3.6\n+ - 3.7\n install:\n - pip install tox-travis\n script:\ndiff --git a/CHANGES.rst b/CHANGES.rst\nindex 7b614fd..09a6484 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,6 +14,9 @@ New features:\n waitress + ZServer, and a deprecation warning for \'zserver-threads\'.\n [tschorr]\n \n+- Add support for Python 3.7 while dropping official support for Python 3.5.\n+ (`#60 <https://github.com/plone/plone.recipe.zope2instance/issues/60>`_)\n+\n Bug fixes:\n \n - Make comments in zcml values work, even if not starting at the beginning of the line;\ndiff --git a/README.rst b/README.rst\nindex 313adcc..32e8664 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -23,7 +23,7 @@ You can use it with a part like this::\n zcml = my.distribution\n \n .. ATTENTION::\n- This release is targeted at Plone 5.2, ZODB 5, Zope 4, and Python 2.7 or 3.5.\n+ This release is targeted at Plone 5.2, ZODB 5, Zope 4, and Python 2.7, 3.6 or 3.7.\n If you are using this recipe with earlier versions, you should use one of the releases from the 4.x series.\n \n Options\ndiff --git a/setup.py b/setup.py\nindex 9f2d938..de3223c 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -27,7 +27,6 @@\n "Programming Language :: Python :: 2",\n "Programming Language :: Python :: 2.7",\n "Programming Language :: Python :: 3",\n- "Programming Language :: Python :: 3.5",\n "Programming Language :: Python :: 3.6",\n "Programming Language :: Python :: 3.7",\n "Programming Language :: Python :: Implementation :: CPython",\ndiff --git a/tox.ini b/tox.ini\nindex 9e1ebae..632290a 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -2,8 +2,8 @@\n envlist =\n flake8,\n py27,\n- py35,\n py36,\n+ py37,\n coverage,\n \n skip_missing_interpreters = False\n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-29T11:23:07+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/73b4a7a6cfb40ea0331c0c8bda6c1cd9e7e6de4a

Clean up MANIFEST.

Files changed:
M MANIFEST.in

b'diff --git a/MANIFEST.in b/MANIFEST.in\nindex 22594b9..c1dc75a 100644\n--- a/MANIFEST.in\n+++ b/MANIFEST.in\n@@ -1,5 +1,4 @@\n include *.rst\n-\n-recursive-include src *\n-\n-global-exclude *pyc\n+recursive-include src *.txt\n+recursive-include src *.xml\n+recursive-include src *.zcml\n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-29T11:23:31+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/b3d2ca2863ed3ca7aa637327e35ac54e0a7ccaaf

Zope 2 is no longer supported.

Files changed:
M README.rst
M setup.py

b'diff --git a/README.rst b/README.rst\nindex 32e8664..ef94558 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -7,7 +7,8 @@ Introduction\n .. image:: http://img.shields.io/travis/plone/plone.recipe.zope2instance.svg\n :target: https://travis-ci.org/plone/plone.recipe.zope2instance\n \n-This recipe creates and configures a Zope 2 instance in parts. It also\n+This recipe creates and configures a Zope instance in parts.\n+(Despite its name it nowadays only works for Zope 4+.) It also\n installs a control script, which is like zopectl, in the bin/ directory.\n The name of the control script is the the name of the part in buildout.\n By default various runtime and log information will be stored inside the var/\n@@ -513,10 +514,10 @@ http-header-max-length\n Additional Control Script `debug`, `console` and `run` Commands\n ---------------------------------------------------------------\n \n-The extended Zope 2 control script installed by this recipe, usually\n+The extended Zope control script installed by this recipe, usually\n `bin/instance` by convention, offers a `debug` command and another\n `run` command. The `debug` command starts an interactive Python\n-prompt with the Zope 2 application available via the `app` name.\n+prompt with the Zope application available via the `app` name.\n Similarly, the `run` command accepts a Python script as an argument\n that will be run under the same conditions.\n \n@@ -535,7 +536,7 @@ Note that these options must come before the script name,\n e.g. `bin/instance -RLOPlone/front-page debug`\n \n The `console` command is similar to the fg command, but it does not\n-create a subprocess to start up Zope 2. This is useful for two\n+create a subprocess to start up Zope. This is useful for two\n use cases. First, the supervisor program, to supervise long running\n processes like a Zope, require the process not to fork away, so that\n supervisor can control it.\ndiff --git a/setup.py b/setup.py\nindex de3223c..57e02c5 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -11,7 +11,7 @@\n version=version,\n author="Hanno Schlichting",\n author_email="hanno@hannosch.eu",\n- description="Buildout recipe for creating a Zope 2 instance",\n+ description="Buildout recipe for creating a Zope instance",\n long_description=((open(\'README.rst\').read() + \'\\n\' +\n open(\'CHANGES.rst\').read())),\n license="ZPL 2.1",\n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-29T11:23:48+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/1fb14111d1d5ee56dbfd4d7ad783a4a0614ed348

Update to current Zope release.

Files changed:
M tox.ini

b'diff --git a/tox.ini b/tox.ini\nindex 632290a..f5ee1e8 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -12,9 +12,9 @@ skip_missing_interpreters = False\n usedevelop = true\n commands =\n coverage run {envbindir}/zope-testrunner --test-path=src\n+extras = test\n deps =\n- -r https://zopefoundation.github.io/Zope/releases/4.0b5/requirements-full.txt\n- .[test]\n+ -r https://zopefoundation.github.io/Zope/releases/4.0b7/requirements-full.txt\n coverage\n setenv =\n COVERAGE_FILE=.coverage.{envname}\n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-29T11:24:01+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/a60651ac47df664d60268f7a4b3bcfdf28c147f3

Clean up.

Files changed:
M setup.cfg
M setup.py

b'diff --git a/setup.cfg b/setup.cfg\nindex ea05550..5f5b7ea 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -5,9 +5,5 @@ ignore =\n bootstrap.py\n tox.ini\n \n-When Python 2-3 compatible:\n [bdist_wheel]\n universal = 1\n-\n-[zest.releaser]\n-create-wheel = yes\ndiff --git a/setup.py b/setup.py\nindex 57e02c5..a389fe6 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -15,8 +15,8 @@\n long_description=((open(\'README.rst\').read() + \'\\n\' +\n open(\'CHANGES.rst\').read())),\n license="ZPL 2.1",\n- keywords="zope2 buildout",\n- url=\'https://pypi.org/project/plone.recipe.zope2instance\',\n+ keywords="zope buildout",\n+ url=\'https://github.com/plone/plone.recipe.zope2instance\',\n classifiers=[\n "License :: OSI Approved :: Zope Public License",\n "Framework :: Buildout",\n'

Repository: plone.recipe.zope2instance


Branch: refs/heads/master
Date: 2018-11-30T09:38:50+01:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: https://github.com/plone/plone.recipe.zope2instance/commit/813651d56bfbcde356c248ea6c1154748f2326fa

Merge pull request #63 from plone/py37

Add support for Python 3.7 while dropping support for Python 3.5.

Files changed:
M .travis.yml
M CHANGES.rst
M MANIFEST.in
M README.rst
M setup.cfg
M setup.py
M tox.ini

b'diff --git a/.travis.yml b/.travis.yml\nindex ac482ce..6e68b0b 100644\n--- a/.travis.yml\n+++ b/.travis.yml\n@@ -1,8 +1,9 @@\n language: python\n+dist: xenial\n python:\n - 2.7\n- - 3.5\n - 3.6\n+ - 3.7\n install:\n - pip install tox-travis\n script:\ndiff --git a/CHANGES.rst b/CHANGES.rst\nindex 7b614fd..09a6484 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -14,6 +14,9 @@ New features:\n waitress + ZServer, and a deprecation warning for \'zserver-threads\'.\n [tschorr]\n \n+- Add support for Python 3.7 while dropping official support for Python 3.5.\n+ (`#60 <https://github.com/plone/plone.recipe.zope2instance/issues/60>`_)\n+\n Bug fixes:\n \n - Make comments in zcml values work, even if not starting at the beginning of the line;\ndiff --git a/MANIFEST.in b/MANIFEST.in\nindex 22594b9..c1dc75a 100644\n--- a/MANIFEST.in\n+++ b/MANIFEST.in\n@@ -1,5 +1,4 @@\n include *.rst\n-\n-recursive-include src *\n-\n-global-exclude *pyc\n+recursive-include src *.txt\n+recursive-include src *.xml\n+recursive-include src *.zcml\ndiff --git a/README.rst b/README.rst\nindex 313adcc..ef94558 100644\n--- a/README.rst\n+++ b/README.rst\n@@ -7,7 +7,8 @@ Introduction\n .. image:: http://img.shields.io/travis/plone/plone.recipe.zope2instance.svg\n :target: https://travis-ci.org/plone/plone.recipe.zope2instance\n \n-This recipe creates and configures a Zope 2 instance in parts. It also\n+This recipe creates and configures a Zope instance in parts.\n+(Despite its name it nowadays only works for Zope 4+.) It also\n installs a control script, which is like zopectl, in the bin/ directory.\n The name of the control script is the the name of the part in buildout.\n By default various runtime and log information will be stored inside the var/\n@@ -23,7 +24,7 @@ You can use it with a part like this::\n zcml = my.distribution\n \n .. ATTENTION::\n- This release is targeted at Plone 5.2, ZODB 5, Zope 4, and Python 2.7 or 3.5.\n+ This release is targeted at Plone 5.2, ZODB 5, Zope 4, and Python 2.7, 3.6 or 3.7.\n If you are using this recipe with earlier versions, you should use one of the releases from the 4.x series.\n \n Options\n@@ -513,10 +514,10 @@ http-header-max-length\n Additional Control Script `debug`, `console` and `run` Commands\n ---------------------------------------------------------------\n \n-The extended Zope 2 control script installed by this recipe, usually\n+The extended Zope control script installed by this recipe, usually\n `bin/instance` by convention, offers a `debug` command and another\n `run` command. The `debug` command starts an interactive Python\n-prompt with the Zope 2 application available via the `app` name.\n+prompt with the Zope application available via the `app` name.\n Similarly, the `run` command accepts a Python script as an argument\n that will be run under the same conditions.\n \n@@ -535,7 +536,7 @@ Note that these options must come before the script name,\n e.g. `bin/instance -RLOPlone/front-page debug`\n \n The `console` command is similar to the fg command, but it does not\n-create a subprocess to start up Zope 2. This is useful for two\n+create a subprocess to start up Zope. This is useful for two\n use cases. First, the supervisor program, to supervise long running\n processes like a Zope, require the process not to fork away, so that\n supervisor can control it.\ndiff --git a/setup.cfg b/setup.cfg\nindex ea05550..5f5b7ea 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -5,9 +5,5 @@ ignore =\n bootstrap.py\n tox.ini\n \n-When Python 2-3 compatible:\n [bdist_wheel]\n universal = 1\n-\n-[zest.releaser]\n-create-wheel = yes\ndiff --git a/setup.py b/setup.py\nindex 9f2d938..a389fe6 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -11,12 +11,12 @@\n version=version,\n author="Hanno Schlichting",\n author_email="hanno@hannosch.eu",\n- description="Buildout recipe for creating a Zope 2 instance",\n+ description="Buildout recipe for creating a Zope instance",\n long_description=((open(\'README.rst\').read() + \'\\n\' +\n open(\'CHANGES.rst\').read())),\n license="ZPL 2.1",\n- keywords="zope2 buildout",\n- url=\'https://pypi.org/project/plone.recipe.zope2instance\',\n+ keywords="zope buildout",\n+ url=\'https://github.com/plone/plone.recipe.zope2instance\',\n classifiers=[\n "License :: OSI Approved :: Zope Public License",\n "Framework :: Buildout",\n@@ -27,7 +27,6 @@\n "Programming Language :: Python :: 2",\n "Programming Language :: Python :: 2.7",\n "Programming Language :: Python :: 3",\n- "Programming Language :: Python :: 3.5",\n "Programming Language :: Python :: 3.6",\n "Programming Language :: Python :: 3.7",\n "Programming Language :: Python :: Implementation :: CPython",\ndiff --git a/tox.ini b/tox.ini\nindex 9e1ebae..f5ee1e8 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -2,8 +2,8 @@\n envlist =\n flake8,\n py27,\n- py35,\n py36,\n+ py37,\n coverage,\n \n skip_missing_interpreters = False\n@@ -12,9 +12,9 @@ skip_missing_interpreters = False\n usedevelop = true\n commands =\n coverage run {envbindir}/zope-testrunner --test-path=src\n+extras = test\n deps =\n- -r https://zopefoundation.github.io/Zope/releases/4.0b5/requirements-full.txt\n- .[test]\n+ -r https://zopefoundation.github.io/Zope/releases/4.0b7/requirements-full.txt\n coverage\n setenv =\n COVERAGE_FILE=.coverage.{envname}\n'

0 comments on commit 8a7a4fd

Please sign in to comment.