Friday, May 2, 2008

The test suite and disable 2to3 fixers

I'm writing SWIG makefile rules for testing today. Now I can see the test progress running well when I type "make check-python3-test-suite". It wonders me that so many tests can be passed! However, the failed tests should be the hardest part.

I have spend some time to work on Python 3's relative import, which mentioned on PEP 328, and PEP 366 seems a solution to my problem. But there is no 2to3 fixer to apply the PEP 366, so I had to disable the "import" fixer. The 2to3 has no option to disable a fixer now, so, this is how I did that:

$ 2to3 `2to3 -l | grep -v -E "Available|import$" | awk '{print "-f "$0}'` foo.py

This is the first time I tried to use awk, and the first time to write such a complicated command line. However, there should be a more clever way to do it.

The test suite still running, very slow, maybe due to that awful command line?

1 comment:

little ant said...

My dear, you are my hero :) I am proud of you.and thanks for all you have done for me. Cheer! --yours ant :)