[PEAK] trying to run peak-rules on python3

PJ Eby pje at telecommunity.com
Tue Mar 19 17:54:33 EDT 2013

On Tue, Mar 19, 2013 at 2:57 PM, Hervé Coatanhay
<herve.coatanhay at gmail.com> wrote:
> So from what I'm understanding BytesCodeAssembler is not in a too bad shape
> atm regarding py3 if i just want to run PEAK-Rules (i still have to look
> into the problem with `from_function`).

PEAK-Rules does depend on from_function, so yes.

Most of the problems in the tests that you sent earlier had to do with
nested arguments, e.g  "def x((y,z), a):", which are not supported on
Python 3.  So it may be that it's in that functionality where you're
experiencing issues.

> The way i run the test is:
> nosetests --with-doctest --doctest-extension=txt
> so whitespaces differences should be ignored properly
>>     >>> from peak.util.assembler import TryExcept
>>     >>> c = Code()
>>     >>> c.return_(
>>     ...     TryExcept(
>>     ...         Return(1),                                      # body
>>     ...         [(Const(KeyError),2), (Const(TypeError),3)],    # handlers
>>     ...         Return(4)                                       # else
>> clause
>>     ...     )
>>     ... )
> It was a typo as i replace both exceptions.KeyError and exceptions.TypeError
> with KeyError.
> As of running PEAK-Rules tests, i have trouble running them because the
> previous command does not find any. How do you run them actually ?

For both packages, you should be using "python setup.py test", or you
will miss stuff or have incorrect option settings.

More information about the PEAK mailing list