Re: trying to run peak-rules on python3

PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> Tue, 19 Mar 2013 17:54:33 -0400
Newsgroups gmane.comp.python.peak
Message-ID <CALeMXf5=Ua4im7Zoiid1wA92XhwEKzSmOndGK2nSZNvqsckLEA@mail.gmail.com>
On Tue, Mar 19, 2013 at 2:57 PM, Herv=E9 Coatanhay
<[email protected]> wrote:
> So from what I'm understanding BytesCodeAssembler is not in a too bad sha=
pe
> 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=3Dtxt
> --doctest-options=3D'+ELLIPSIS,+NORMALIZE_WHITESPACE'
>
> so whitespaces differences should be ignored properly
>
>>     >>> from peak.util.assembler import TryExcept
>>     >>> c =3D Code()
>>     >>> c.return_(
>>     ...     TryExcept(
>>     ...         Return(1),                                      # body
>>     ...         [(Const(KeyError),2), (Const(TypeError),3)],    # handle=
rs
>>     ...         Return(4)                                       # else
>> clause
>>     ...     )
>>     ... )
>
> It was a typo as i replace both exceptions.KeyError and exceptions.TypeEr=
ror
> 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.