Re: [Zope-dev] Adapter for class with slots

2009-12-06 Thread Wolfgang Schnerring
* Shane Hathaway  [2009-12-03 11:44]:
> Wolfgang Schnerring wrote:
>> The minimal reproduction recipe to see the error is this:
>> 
>> class Slotted(object):
>> __slots__ = ('__provides__')
>> 
>> zope.component.provideAdapter(
>> lambda x: True, (Slotted,), zope.interface.Interface)
>> 
>> Which will raise
>>   File 
>> "/home/wosc/.python-eggs/zope.component-3.7.1-py2.6.egg/zope/component/registry.py",
>>   line 419, in _getAdapterRequired
>>   elif not ISpecification.providedBy(r):
>>   TypeError: 'member_descriptor' object is not callable
>
> It looks to me like a possible bug in zope.interface.  Try deleting 
> _zope_interface_coptimizations.so to hopefully expand that traceback.

Thanks for the hint! This enabled me to step through all of it with pdb,
which turns up zope/interface/declarations.py:1249

  def getObjectSpecification(ob):
  provides = getattr(ob, '__provides__', None)
  if provides is not None:
  return provides
  [...]

So it seems that __provides__ is part of the zope.interface mechanics,
and if unset that attribute should not exist -- but when using __slots__
it always exists, namely as a 'member_descriptor' object.

I'll try and see whether I can come up with a way for zope.interface to
do the Right Thing(tm) in this situation.

Wolfgang

___
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] Bootstrapping ZCA for Python 3.

2009-12-06 Thread Lennart Regebro
On Mon, Dec 7, 2009 at 08:27, Wolfgang Schnerring  wrote:
> When I worked on py3 stuff on the DZUG sprint in September, we broke out
> of that catch-22 by porting zope.testing first, and running its test
> using , patched[1] to pick up
> tests via the test_suite() methods. That way we could run the tests of
> zope.testing under py3 without needing zope.testing itself or
> zc.buildout to do so, so porting zope.testing could be tackled.

OK, I'll try that, thanks.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
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] Bootstrapping ZCA for Python 3.

2009-12-06 Thread Wolfgang Schnerring
* Lennart Regebro  [2009-12-06 21:14]:
> Time had therefore come to zope.testing. Why
> zope.testing? Because most components in zope.* uses zc.buildout, and
> zc.buildouts tests uses zope.testing. But of course we here have a
> bootstrapping problem, zope.testing of course also uses buildout.

When I worked on py3 stuff on the DZUG sprint in September, we broke out
of that catch-22 by porting zope.testing first, and running its test
using , patched[1] to pick up
tests via the test_suite() methods. That way we could run the tests of
zope.testing under py3 without needing zope.testing itself or
zc.buildout to do so, so porting zope.testing could be tackled.

Our work from then is on the regebro-python3 branch (which might be
familiar ;-). I don't quite remember how far we've come. I *think* most
of the porting work is done and we were last working on integrating
Distribute/2to3 into the setup.py, but got hung up on the Distribute
side of things.

Wolfgang

[1]
@@ -54,9 +54,12 @@
 if isinstance(obj, type) and issubclass(obj, unittest.TestCase):
 tests.append(self.loadTestsFromTestCase(obj))
 
-load_tests = getattr(module, 'load_tests', None)
+load_tests = getattr(module, 'test_suite', None)
 if use_load_tests and load_tests is not None:
-return load_tests(self, tests, None)
+tests = load_tests()
+if not tests:
+return lambda x: None
+return tests
 return self.suiteClass(tests)

___
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] zope.testing.testrunner.debug.post_mortem and try/finally

2009-12-06 Thread Christian Theune
On 12/03/2009 04:08 PM, Benji York wrote:
> On Thu, Dec 3, 2009 at 9:43 AM, Marius Gedminas  wrote:
>> I've had some success with this:
>
> [snip code]
>
> Nice.  I'd love to see this wired into the testrunner so people could
> specify breakpoints on the command line while running tests.
>
> If no one else gets around to that, I might.  One day.

Well, if someone threw this code in the bug tracker on the wish list, 
then it's even more likely someone will get around to do it. Some day. ;)

-- 
Christian Theune · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

___
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] Bootstrapping ZCA for Python 3.

2009-12-06 Thread Lennart Regebro
In the effort to port the component architecture to Python 3, some
progress has been done. I think zope.interface and zope.exception is
ready for some serious testing and zope.event is so trivial it doesn't
need any testing. :) Time had therefore come to zope.testing. Why
zope.testing? Because most components in zope.* uses zc.buildout, and
zc.buildouts tests uses zope.testing. But of course we here have a
bootstrapping problem, zope.testing of course also uses buildout.

In zope.interface and zope.exception I fixed this by adding a
test_suite parameter to setup(), so that the tests can be run with
"python setup.py test". However, with zope.testing this doesn't work,
for some reason. Many tests fail when you run the testing through
setup.py, even though they work when run with a bin/test generated by
setuptools.

I'm stumped as to why this is, the changes are very strange, such as
two temporary files being created in the buildout case, but only one
in the setuptoold case. Very strange.

Any insight into breaking this catch 22 is welcome, so we can port
zope.testing to Python 3, and then get on to zc.buildout and then
zope.component, and then the rest should be (in comparison) easy
(although a lot of work).
-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
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: 6 OK

2009-12-06 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Sat Dec  5 12:00:00 2009 UTC to Sun Dec  6 12:00:00 2009 UTC.
There were 6 messages: 6 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.10 Python-2.4.6 : Linux
From: Zope Tests
Date: Sat Dec  5 20:38:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013143.html

Subject: OK : Zope-2.11 Python-2.4.6 : Linux
From: Zope Tests
Date: Sat Dec  5 20:40:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013144.html

Subject: OK : Zope-2.12 Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Dec  5 20:42:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013145.html

Subject: OK : Zope-2.12-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Dec  5 20:44:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013146.html

Subject: OK : Zope-trunk Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Dec  5 20:46:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013147.html

Subject: OK : Zope-trunk-alltests Python-2.6.4 : Linux
From: Zope Tests
Date: Sat Dec  5 20:48:20 EST 2009
URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013148.html

___
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] Zope Tests: 4 OK, 2 Unknown

2009-12-06 Thread Andreas Jung
Am 06.12.09 12:52, schrieb Wichert Akkerman:
> On 12/6/09 02:45 , Tres Seaver wrote:
>   
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Zope Tests Summarizer wrote:
>> 
>>> Summary of messages to the zope-tests list.
>>> Period Fri Dec  4 12:00:00 2009 UTC to Sat Dec  5 12:00:00 2009 UTC.
>>> There were 6 messages: 6 from Zope Tests.
>>>
>>>
>>> Unknown
>>> ---
>>>
>>> Subject: UNKNOWN : Zope-2.12 Python-2.6.4 : Linux
>>> From: Zope Tests
>>> Date: Fri Dec  4 20:48:07 EST 2009
>>> URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013139.html
>>>
>>> Subject: UNKNOWN : Zope-2.12-alltests Python-2.6.4 : Linux
>>> From: Zope Tests
>>> Date: Fri Dec  4 20:50:07 EST 2009
>>> URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013140.html
>>>   
>> These failures are both due to the following:
>>
>> Getting distribution for 'zc.buildout==1.4.1'.
>>Error: Couldn't find a distribution for 'zc.buildout==1.4.1'.
>>
>> Has somebody been doing nasty stuff like removing releases on PyPI?
>> 
> zc.buildout 1.4.1 is still on http://pypi.python.org/simple/zc.buildout
PyPI had an outage according to some reports on Twitter.

Andreas
<>___
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] Zope Tests: 4 OK, 2 Unknown

2009-12-06 Thread Wichert Akkerman
On 12/6/09 02:45 , Tres Seaver wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Zope Tests Summarizer wrote:
>> Summary of messages to the zope-tests list.
>> Period Fri Dec  4 12:00:00 2009 UTC to Sat Dec  5 12:00:00 2009 UTC.
>> There were 6 messages: 6 from Zope Tests.
>>
>>
>> Unknown
>> ---
>>
>> Subject: UNKNOWN : Zope-2.12 Python-2.6.4 : Linux
>> From: Zope Tests
>> Date: Fri Dec  4 20:48:07 EST 2009
>> URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013139.html
>>
>> Subject: UNKNOWN : Zope-2.12-alltests Python-2.6.4 : Linux
>> From: Zope Tests
>> Date: Fri Dec  4 20:50:07 EST 2009
>> URL: http://mail.zope.org/pipermail/zope-tests/2009-December/013140.html
>
> These failures are both due to the following:
>
> Getting distribution for 'zc.buildout==1.4.1'.
>Error: Couldn't find a distribution for 'zc.buildout==1.4.1'.
>
> Has somebody been doing nasty stuff like removing releases on PyPI?

zc.buildout 1.4.1 is still on http://pypi.python.org/simple/zc.buildout

Wichert.
___
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] zope.testing: Define __add__ for RENormalizing

2009-12-06 Thread Christian Zagrodnick
On 2009-06-18 10:00:01 +0200, Christian Zagrodnick  said:

> Hi,
> 
> I suggest defining __add__ for zope.testing.renormalizing.RENormalizing
> 
> which would return a new Checker with the transformers combined.
> 
> This allow better reuse of those checkers without having to define the
> 
> patterns separately. Like
> 
> checker = checker_a + checker_b.

Finally got that in: r106221.


-- 
Christian Zagrodnick · c...@gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · fax +49 345 1229889 1
Zope and Plone consulting and development


___
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 )