Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 12:19 +0100, Jan-Carel Brand wrote:

big snip

 Thanks for the review.
 
 I've committed my changes and ran the tests with Python 2.6 and 2.7. 
 I don't have Python 3.x handy but will compile the latest and test with
 that as well.

Ok, I tested zope.schema in python 3.2.2 and there were some errors in
test_vocabulary.py that I fixed.

They were all related to the KeysView and ValuesView objects (being
returned by keys() and values() on an OrderedDict) not being indexable.

There is however still one more error when testing with Python 3.2.2,
but this is related to the IContextSourceBinder validation changes made
by rogerineichen.

First the error:

 FAIL: test_validate_source
 (zope.schema.tests.test_choice.ContextSourceBinder_ChoiceFieldTests)
 --
 Traceback (most recent call last):
   File
 /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/tests/test_choice.py,
  line 133, in test_validate_source
 choice = Choice(source=s)
   File
 /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/_field.py,
 line 281, in __init__
 IContextSourceBinder.providedBy(vocabulary))
 AssertionError
 
The vocabulary is of type SampleContextSourceBinder from test_choice.py,
which does implement IContextSourceBinder.

 class SampleContextSourceBinder(object):
 implements(IContextSourceBinder)
 def __call__(self, context):
 return SampleVocabulary()
 
Looking at it in pdb:

 (Pdb) p vocabulary
 zope.schema.tests.test_choice.SampleContextSourceBinder object at
 0x3236310
 (Pdb) pp vocabulary.__provides__.__iro__
 (InterfaceClass zope.interface.Interface,)
 
Just to double-check, I looked at this vocabulary in Python 2.7:

 (Pdb) vocabulary.__provides__.__iro__
 (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
 InterfaceClass zope.interface.Interface)
 
There it *does* provide IContextSourceBinder.

Any ideas why this vocabulary doesn't provide it in Python 3?

Regards
JC

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Marius Gedminas
On Thu, Mar 22, 2012 at 12:19:39PM +0100, Jan-Carel Brand wrote:
 On Wed, 2012-03-21 at 19:58 +0200, Marius Gedminas wrote:
  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.
 
 Sure, my pypi username is: jcbrand

You now have PyPI access to zope.schema.


One detail I may have forgotten to mention about the release process:
sometimes setup.py sdist produces an incomplete archive.  This happens
every time Subversion changes its working tree format, until somebody
patches setuptools to understand it.  I think subversion 1.7 changed the
format again; I don't know if setuptools can handle it yet -- I'm still
on svn 1.6 myself.

So it may be a good idea to run python setup.py sdist and compare the
file list in dists/*.tar.gz with the file list in the current PyPI
archive, before you actually do the release with fullrelease.  Actually
zest.releaser's fullrelease has lots of continue? [y/n] prompts that
let you do the inspection before the final upload.  I just feel better
when I do it by hand, on those rare occasions when I'm not sure about
the state of my setuptools after a distro upgrade.  YMMV.  And the
chances of breakage are low, and people generally notice it pretty
quickly, and uploading a fixed 4.1.1 is easy (edit MANIFEST.in to make
sure everything is included), so I don't even know why I'm mentioning
all this.  For completeness, I guess...


Marius Gedminas
-- 
If you sat a monkey down in front of a keyboard, the first thing typed would be
a unix command.
-- Bill Lye


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 19:07 +0200, Marius Gedminas wrote:
 On Thu, Mar 22, 2012 at 12:19:39PM +0100, Jan-Carel Brand wrote:
  On Wed, 2012-03-21 at 19:58 +0200, Marius Gedminas wrote:
   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.
  
  Sure, my pypi username is: jcbrand
 
 You now have PyPI access to zope.schema.
 
 
 One detail I may have forgotten to mention about the release process:
 sometimes setup.py sdist produces an incomplete archive.  This happens
 every time Subversion changes its working tree format, until somebody
 patches setuptools to understand it.  I think subversion 1.7 changed the
 format again; I don't know if setuptools can handle it yet -- I'm still
 on svn 1.6 myself.
 
 So it may be a good idea to run python setup.py sdist and compare the
 file list in dists/*.tar.gz with the file list in the current PyPI
 archive, before you actually do the release with fullrelease.  Actually
 zest.releaser's fullrelease has lots of continue? [y/n] prompts that
 let you do the inspection before the final upload.  I just feel better
 when I do it by hand, on those rare occasions when I'm not sure about
 the state of my setuptools after a distro upgrade.  YMMV.  And the
 chances of breakage are low, and people generally notice it pretty
 quickly, and uploading a fixed 4.1.1 is easy (edit MANIFEST.in to make
 sure everything is included), so I don't even know why I'm mentioning
 all this.  For completeness, I guess...

Thanks, it's helpful.

setuptools also doesn't play nicely with git. So I've had to edit
MANIFESET.in before. I'll double check manually.

There is however still the Python 3 bug in zope.schema. (See my previous
post).

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Marius Gedminas
On Thu, Mar 22, 2012 at 03:27:20PM +0100, Jan-Carel Brand wrote:
 On Thu, 2012-03-22 at 12:19 +0100, Jan-Carel Brand wrote:
  Thanks for the review.
  
  I've committed my changes and ran the tests with Python 2.6 and 2.7. 
  I don't have Python 3.x handy but will compile the latest and test with
  that as well.
 
 Ok, I tested zope.schema in python 3.2.2 and there were some errors in
 test_vocabulary.py that I fixed.

I'm in awe of your dedication.  I myself don't even know how to run the
zope.schema testsuite under Python 3:

$ python3.2 bootstrap.py 
  File bootstrap.py, line 63
exec urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
   ^
SyntaxError: invalid syntax

Well, ok, I may be exaggerating a bit.

$ virtualenv -p python3.2 py32
$ py32/bin/python setup.py develop
... this takes a long time... I miss my buildout egg cache ...
$ py32/bin/pip install zope.testrunner
$ py32/bin/pip install zope.testing  # have to install test extras by hand?
$ py32/bin/zope-testrunner --test-path=src
...
Ran 255 tests with 1 failures and 0 errors in 0.206 seconds.

 There is however still one more error when testing with Python 3.2.2,
 but this is related to the IContextSourceBinder validation changes made
 by rogerineichen.
 
 First the error:
 
  FAIL: test_validate_source
  (zope.schema.tests.test_choice.ContextSourceBinder_ChoiceFieldTests)
  --
  Traceback (most recent call last):
File
  /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/tests/test_choice.py,
   line 133, in test_validate_source
  choice = Choice(source=s)
File
  /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/_field.py,
  line 281, in __init__
  IContextSourceBinder.providedBy(vocabulary))
  AssertionError
  
 The vocabulary is of type SampleContextSourceBinder from test_choice.py,
 which does implement IContextSourceBinder.
 
  class SampleContextSourceBinder(object):
  implements(IContextSourceBinder)
  def __call__(self, context):
  return SampleVocabulary()
  
 Looking at it in pdb:
 
  (Pdb) p vocabulary
  zope.schema.tests.test_choice.SampleContextSourceBinder object at
  0x3236310
  (Pdb) pp vocabulary.__provides__.__iro__
  (InterfaceClass zope.interface.Interface,)
  
 Just to double-check, I looked at this vocabulary in Python 2.7:
 
  (Pdb) vocabulary.__provides__.__iro__
  (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
  InterfaceClass zope.interface.Interface)
  
 There it *does* provide IContextSourceBinder.
 
 Any ideas why this vocabulary doesn't provide it in Python 3?

This smells like a bug in zope.interface, and not in zope.schema:

$ py32/bin/python
Python 3.2.2 (default, Sep  5 2011, 22:09:30) 
[GCC 4.6.1] on linux2
Type help, copyright, credits or license for more information.
 from zope.interface import Interface, implements
 class IFoo(Interface): pass
... 
 class Foo(object): implements(IFoo)
... 
 IFoo.implementedBy(Foo)
False
 IFoo.providedBy(Foo())
False

In other words I don't think it should block the release of zope.schema.

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Brian Sutherland
On Thu, Mar 22, 2012 at 03:27:20PM +0100, Jan-Carel Brand wrote:
  (Pdb) vocabulary.__provides__.__iro__
  (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
  InterfaceClass zope.interface.Interface)
  
 There it *does* provide IContextSourceBinder.
 
 Any ideas why this vocabulary doesn't provide it in Python 3?

A variant of this one, perhaps:
https://bugs.launchpad.net/zope.interface/+bug/911851

-- 
Brian Sutherland
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Jan-Carel Brand
On Thu, 2012-03-22 at 19:39 +0200, Marius Gedminas wrote:
 On Thu, Mar 22, 2012 at 03:27:20PM +0100, Jan-Carel Brand wrote:
  On Thu, 2012-03-22 at 12:19 +0100, Jan-Carel Brand wrote:
   Thanks for the review.
   
   I've committed my changes and ran the tests with Python 2.6 and 2.7. 
   I don't have Python 3.x handy but will compile the latest and test with
   that as well.
  
  Ok, I tested zope.schema in python 3.2.2 and there were some errors in
  test_vocabulary.py that I fixed.
 
 I'm in awe of your dedication.  I myself don't even know how to run the
 zope.schema testsuite under Python 3:
 
 $ python3.2 bootstrap.py 
   File bootstrap.py, line 63
 exec 
 urllib2.urlopen('http://python-distribute.org/distribute_setup.py'
^
 SyntaxError: invalid syntax
 
 Well, ok, I may be exaggerating a bit.
 
 $ virtualenv -p python3.2 py32
 $ py32/bin/python setup.py develop
 ... this takes a long time... I miss my buildout egg cache ...
 $ py32/bin/pip install zope.testrunner
 $ py32/bin/pip install zope.testing  # have to install test extras by 
 hand?
 $ py32/bin/zope-testrunner --test-path=src
 ...
 Ran 255 tests with 1 failures and 0 errors in 0.206 seconds.

lol. Yeah, it took me a while to figure it out as well. 

I instead ran: python setup.py test

That also works.

  There is however still one more error when testing with Python 3.2.2,
  but this is related to the IContextSourceBinder validation changes made
  by rogerineichen.
  
  First the error:
  
   FAIL: test_validate_source
   (zope.schema.tests.test_choice.ContextSourceBinder_ChoiceFieldTests)
   --
   Traceback (most recent call last):
 File
   /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/tests/test_choice.py,
line 133, in test_validate_source
   choice = Choice(source=s)
 File
   /home/jc/dev/python3.2.2/src/zope.schema/src/zope/schema/_field.py,
   line 281, in __init__
   IContextSourceBinder.providedBy(vocabulary))
   AssertionError
   
  The vocabulary is of type SampleContextSourceBinder from test_choice.py,
  which does implement IContextSourceBinder.
  
   class SampleContextSourceBinder(object):
   implements(IContextSourceBinder)
   def __call__(self, context):
   return SampleVocabulary()
   
  Looking at it in pdb:
  
   (Pdb) p vocabulary
   zope.schema.tests.test_choice.SampleContextSourceBinder object at
   0x3236310
   (Pdb) pp vocabulary.__provides__.__iro__
   (InterfaceClass zope.interface.Interface,)
   
  Just to double-check, I looked at this vocabulary in Python 2.7:
  
   (Pdb) vocabulary.__provides__.__iro__
   (InterfaceClass zope.schema.interfaces.IContextSourceBinder,
   InterfaceClass zope.interface.Interface)
   
  There it *does* provide IContextSourceBinder.
  
  Any ideas why this vocabulary doesn't provide it in Python 3?
 
 This smells like a bug in zope.interface, and not in zope.schema:
 
 $ py32/bin/python
 Python 3.2.2 (default, Sep  5 2011, 22:09:30) 
 [GCC 4.6.1] on linux2
 Type help, copyright, credits or license for more information.
  from zope.interface import Interface, implements
  class IFoo(Interface): pass
 ... 
  class Foo(object): implements(IFoo)
 ... 
  IFoo.implementedBy(Foo)
 False
  IFoo.providedBy(Foo())
 False
 
 In other words I don't think it should block the release of zope.schema.

Yeah, as Brian mentioned:
https://bugs.launchpad.net/zope.interface/+bug/911851

Ok, I'll release tomorrow morning when I'm fresh.

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Charlie Clark

Am 22.03.2012, 15:27 Uhr, schrieb Jan-Carel Brand li...@opkode.com:


Any ideas why this vocabulary doesn't provide it in Python 3?


I think you have to use the @implements class decorator for Python 3.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting  Research
German Office
Kronenstr. 27a
Düsseldorf
D- 40217
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] New release for zope.schema

2012-03-22 Thread Marius Gedminas
On Thu, Mar 22, 2012 at 07:04:29PM +0100, Jan-Carel Brand wrote:
 On Thu, 2012-03-22 at 19:39 +0200, Marius Gedminas wrote:
  $ virtualenv -p python3.2 py32
  $ py32/bin/python setup.py develop
  ... this takes a long time... I miss my buildout egg cache ...
  $ py32/bin/pip install zope.testrunner
  $ py32/bin/pip install zope.testing  # have to install test extras by 
  hand?
  $ py32/bin/zope-testrunner --test-path=src
  ...
  Ran 255 tests with 1 failures and 0 errors in 0.206 seconds.
 
 lol. Yeah, it took me a while to figure it out as well. 
 
 I instead ran: python setup.py test
 
 That also works.

D'oh! :-)

 Yeah, as Brian mentioned:
 https://bugs.launchpad.net/zope.interface/+bug/911851

Given that zope.schema already requires Python 2.6 or newer, I've committed
this fix:

--- src/zope/schema/tests/test_choice.py(revision 124693)
+++ src/zope/schema/tests/test_choice.py(working copy)
@@ -16,7 +16,7 @@
 import unittest
 
 from six import u
-from zope.interface import implements
+from zope.interface import implementer
 from zope.schema import vocabulary
 from zope.schema import Choice
 from zope.schema.interfaces import ConstraintNotSatisfied
@@ -114,8 +114,8 @@ class Vocabulary_ChoiceFieldTests(unitte
 self.assertRaises(ValueError, choice.validate, value)
 
 
+@implementer(IContextSourceBinder)
 class SampleContextSourceBinder(object):
-implements(IContextSourceBinder)
 def __call__(self, context):
 return SampleVocabulary()
 

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zope-tests - OK: 39

2012-03-22 Thread Zope tests summarizer
This is the summary for test reports received on the 
zope-tests list between 2012-03-21 00:00:00 UTC and 2012-03-22 00:00:00 UTC:

See the footnotes for test reports of unsuccessful builds.

An up-to date view of the builders is also available in our 
buildbot documentation: 
http://docs.zope.org/zopetoolkit/process/buildbots.html#the-nightly-builds

Reports received


   ZTK 1.0 / Python2.4.6 Linux 64bit
   ZTK 1.0 / Python2.5.5 Linux 64bit
   ZTK 1.0 / Python2.6.7 Linux 64bit
   ZTK 1.0dev / Python2.4.6 Linux 64bit
   ZTK 1.0dev / Python2.5.5 Linux 64bit
   ZTK 1.0dev / Python2.6.7 Linux 64bit
   ZTK 1.1 / Python2.5.5 Linux 64bit
   ZTK 1.1 / Python2.6.7 Linux 64bit
   ZTK 1.1 / Python2.7.2 Linux 64bit
   Zope 3.4 KGS / Python2.4.6 64bit linux
   Zope 3.4 KGS / Python2.5.5 64bit linux
   Zope 3.4 Known Good Set / py2.4-32bit-linux
   Zope 3.4 Known Good Set / py2.4-64bit-linux
   Zope 3.4 Known Good Set / py2.5-32bit-linux
   Zope 3.4 Known Good Set / py2.5-64bit-linux
   Zope-2.10 Python-2.4.6 : Linux
   Zope-2.11 Python-2.4.6 : Linux
   Zope-2.12 Python-2.6.6 : Linux
   Zope-2.12-alltests Python-2.6.6 : Linux
   Zope-2.13 Python-2.6.6 : Linux
   Zope-2.13-alltests Python-2.6.6 : Linux
   Zope-trunk Python-2.6.6 : Linux
   Zope-trunk-alltests Python-2.6.6 : Linux
   winbot / ZODB_dev py_265_win32
   winbot / ZODB_dev py_265_win64
   winbot / ZODB_dev py_270_win32
   winbot / ZODB_dev py_270_win64
   winbot / ztk_10 py_254_win32
   winbot / ztk_10 py_265_win32
   winbot / ztk_10 py_265_win64
   winbot / ztk_11 py_254_win32
   winbot / ztk_11 py_265_win32
   winbot / ztk_11 py_265_win64
   winbot / ztk_11 py_270_win32
   winbot / ztk_11 py_270_win64
   winbot / ztk_dev py_265_win32
   winbot / ztk_dev py_265_win64
   winbot / ztk_dev py_270_win32
   winbot / ztk_dev py_270_win64

Non-OK results
--

___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )