[Zope-dev] New release for zope.schema

Marius Gedminas marius at gedmin.as
Wed Mar 21 17:58:01 UTC 2012


On Wed, Mar 21, 2012 at 05:29:44PM +0100, Jan-Carel Brand wrote:
> What needs to be done for a new release of zope.schema? (4.1)

(Note: historically zope.schema always used three version components:
4.1.0, not 4.1.)

Somebody with interest and PyPI access has to check it out and run
fullrelease (from zest.releaser).  Ideally, after running the test suite
to make sure it passes.  For all supported Python versions, if possible.
Which are, ideally, enumerated in setup.py as Trove classifiers.

    For packages that have C extension modules there are probably extra
    steps needed to produce Windows binary eggs.  I don't know those
    steps (winbot is involved somehow), so I avoid making releases of
    packages that have C extension modules.  How do I check if a package
    has C extension modules?  I go to PyPI and look if there are Windows
    binary eggs available for download for the current version.
    zope.schema doesn't, so I'm just including this for general
    reference purposes.

> And is there anything I can do to help speed it up?

Yes: you can bring it up on the mailing list, like you've done here.  ;)

Also, thank you for the convenient diff.  I'll review it.

Also, would you like to have PyPI access to zope.schema, so that you can
do the release yourself?  If so, tell us your PyPI username.

> Even just an alpha/beta release would be very helpful.

I think uploading alpha/beta releases to PyPI is frowned upon, because
tools tend to download them blindly, as if they were final releases.

> svn --non-interactive diff http://svn.zope.org/repos/main/zope.schema/tags/4.0.1 http://svn.zope.org/repos/main/zope.schema/trunk
> Index: CHANGES.txt
> ===================================================================
> --- CHANGES.txt	(.../tags/4.0.1)	(revision 124658)
> +++ CHANGES.txt	(.../trunk)	(revision 124658)
> @@ -2,6 +2,18 @@
>  CHANGES
>  =======
>  
> +4.1 (unreleased)

This should be 4.1.0.

> +------------------
> +
> +- Add TreeVocabulary for nested tree-like vocabularies.
> +
> +- Fix broken Object field validation where the schema contains a Choice with
> +  ICountextSourceBinder source. In this case the vocabulary was not iterable
> +  because the field was not bound and the source binder dien't return the 

Spelling: dien't.

> +  real vocabulary. Added simple test for IContextSourceBinder validation. But a
> +  test with an Object field with a schema using a Choice with
> +  IContextSourceBinder is still missing.
> +
>  4.0.1 (2011-11-14)
>  ------------------
>  
> Index: setup.py
> ===================================================================
> --- setup.py	(.../tags/4.0.1)	(revision 124658)
> +++ setup.py	(.../trunk)	(revision 124658)
> @@ -19,6 +19,7 @@
>  """Setup for zope.schema package
>  """
>  import os
> +import sys
>  from setuptools import setup, find_packages
>  
>  def read(*rnames):
> @@ -60,8 +61,18 @@
>              suite.addTest(mod.test_suite())
>      return suite
>  
> +REQUIRES = [
> +        'setuptools',
> +        'zope.interface >= 3.6.0',
> +        'zope.event',
> +        'six',
> +        ]
> +
> +if sys.version_info < (2 , 7):

No space before the comma.

> +    REQUIRES += ['ordereddict'],

Trailing comma warning!  I do not think this does what you want it to
do:

    >>> REQUIRES = [
    ...         'setuptools',
    ...         'zope.interface >= 3.6.0',
    ...         'zope.event',
    ...         'six',
    ...         ]
    >>> REQUIRES += ['ordereddict'],
    >>> REQUIRES
    ['setuptools', 'zope.interface >= 3.6.0', 'zope.event', 'six', ['ordereddict']]

I don't know if setuptools can handle this correctly, but it feels wrong
anyway.  Please fix.

> +
>  setup(name='zope.schema',
> -      version = '4.0.1',
> +      version = '4.1dev',

This should be '4.1.0dev'.

>        url='http://pypi.python.org/pypi/zope.schema',
>        license='ZPL 2.1',
>        description='zope.interface extension for defining data schemas',
> @@ -81,11 +92,8 @@
>        namespace_packages=['zope',],
>        extras_require={'test': ['zope.testing'],
>                        'docs': ['z3c.recipe.sphinxdoc']},
> -      install_requires=['setuptools',
> -                        'zope.interface >= 3.6.0',
> -                        'zope.event',
> -                        'six',
> -                       ],
> +      install_requires=REQUIRES,
> +      

The blank line (and trailing whitespace) do not seem to be useful here.

>        classifiers=[
>          "Development Status :: 5 - Production/Stable",
>          "Intended Audience :: Developers",
> Index: src/zope/schema/fields.txt
> ===================================================================
> --- src/zope/schema/fields.txt	(.../tags/4.0.1)	(revision 124658)
> +++ src/zope/schema/fields.txt	(.../trunk)	(revision 124658)
> @@ -116,6 +116,9 @@
>  The vocabulary interface is simple enough that writing a custom vocabulary is
>  not too difficult itself.
>  
> +See for example zope.schema.vocabulary.TreeVocabulary for another
> +IBaseVocabulary supporting vocabulary that provides a nested, tree-like structure.

This line is 82 characters long.  Please wrap.  (76 chars is a good choice for
wrapping.)

> +
>  Choices and Collections
>  -----------------------
>  
> @@ -156,3 +159,4 @@
>  
>  This level of indirection may be unnecessary for some applications, and can be
>  disabled with simple ZCML changes within `zope.app`.
> +
> Index: src/zope/schema/vocabulary.py
> ===================================================================
> --- src/zope/schema/vocabulary.py	(.../tags/4.0.1)	(revision 124658)
> +++ src/zope/schema/vocabulary.py	(.../trunk)	(revision 124658)
> @@ -13,14 +13,19 @@
>  ##############################################################################
>  """Vocabulary support for schema.
>  """
> +try:
> +    from collections import OrderedDict
> +except:

Should be 'except ImportError:'.

> +    from ordereddict import OrderedDict
> +
>  from zope.interface.declarations import directlyProvides, implementer
>  from zope.schema.interfaces import ValidationError
...
> + at implementer(ITreeVocabulary)
> +class TreeVocabulary(object):
> +    """ Vocabulary that relies on a tree (i.e nested) structure.
> +    """
> +    # The default implementation uses a dict to create the tree structure. This
> +    # can however be overridden in a subclass by any other IEnumerableMapping
> +    # compliant object type. Python 2.7's OrderableDict for example.

Python 2.7 doesn't have an OrderableDict, does it?  Typo?

> +    terms_factory = OrderedDict
...

> Index: src/zope/schema/tests/test_vocabulary.py
> ===================================================================
> --- src/zope/schema/tests/test_vocabulary.py	(.../tags/4.0.1)	(revision 124658)
> +++ src/zope/schema/tests/test_vocabulary.py	(.../trunk)	(revision 124658)
> @@ -15,9 +15,15 @@
>  """
>  import unittest
>  
> +try:
> +    from collections import OrderedDict
> +except:

Should be 'except ImportError:'.

> +    from ordereddict import OrderedDict
> +
>  from zope.interface.verify import verifyObject
>  from zope.interface.exceptions import DoesNotImplement
>  from zope.interface import Interface, implementer
> +from zope.interface.common.mapping import IEnumerableMapping
>  
>  from zope.schema import interfaces
>  from zope.schema import vocabulary
...

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mail.zope.org/pipermail/zope-dev/attachments/20120321/ccdabd53/attachment.sig>


More information about the Zope-Dev mailing list