Joe Amenta's Blog

July 27, 2010

Back into the swing of things

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 2:08 am

I’ve managed to get myself back to coding after an unexpectedly long absence.  I built up a lot of inertia over all that time, so I’m glad to finally overcome it.

I did hit a snag related to my laptop’s Ubuntu installation; this results in me not being able to run the 3to2 tests right now.  I’ll just commit what I have (the recent change probably does what I think it does, but it’s disabled by default so that it doesn’t bother anyone) and work through this tomorrow.  Shouldn’t take more than a few minutes when I’m fully awake, but I’ve learned from experience that I shouldn’t try to do significant sysadmin stuff this late at night if it’s not time-critical.

July 23, 2010

RL just ate my week

Filed under: 3to2,GSoC 2009,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 5:09 pm

This past week, I’ve just had SO many important things going on in real life.  I’m going to start coding again after this weekend (that’s Monday, July 26), when everything should be settled down.

Currently on my plate is a fixer for the extended funcdef parameter syntax.  I’ve already got tests in the repository, just need to work on implementing the fixer.

On a side note, I’m rather proud of how well lib3to2 does with the Py3k standard library.  Most modules I’ve tried just work, and those that fail tests often fail for other reasons than lib3to2 failures.  For example, lib3to2 doesn’t refactor the io module to fully pass its test, because the io module expects the _io module to behave a certain way.

July 14, 2010

Back from Break

Filed under: 3to2,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 12:25 am

I went to Chicago this weekend and just got back tonight.  Back to work tomorrow!

Edit: OK, maybe not today, I need a few days to chill and get my motivation back.

June 30, 2010

Python 3 Standard Library

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 4:14 pm

I’ve started to use the Python 3 standard library (and tests) for testing lib3to2.  I like this idea, because future developments come in the Python 3 branch only (they’re backported separately).

I’ve found a few bugs and omissions this way, and I think I’ll find a good few more as I go on.

June 23, 2010

Frustrated

Filed under: 3to2,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 2:11 pm

I ran out of ADD drugs (Concerta) late last week.  Thanks to difficulties with insurance, I’m still out.  I should have some more today, but there’s no certainty.

The last time I was able to spend most of a day working on lib3to2 was the last time I had drugs… it’s really frustrating me that I can’t sit for more than a few minutes at a time and work.  I’m trying, I really am!

A solution to the class decorator problem is in the works.  I’d commit what I have right now, but it’s in a halfway state that currently breaks any functionality it had, not to mention the fact that it errors out while running tests.

If I don’t have more ADD drugs by tomorrow, I don’t know what I’m going to do to keep my mind steady.

June 22, 2010

First package tested, first bug found, first *bang head against the wall* moment

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 11:43 am

So I start with the very first pure Python 3 package I find on PyPI (stagger).  3to2 works mostly fine, except for the class decorations used in id3.py: it doesn’t add a newline to the end of the assignment statement that implements the decorations in Python 2 syntax.  ”OK”, I thought, “I’ll make a bug report and add a few more test cases to the test suite for fix_classdecorator.”  Except there was no test suite for fix_classdecorator.

The initial bug is simple: I forgot to (and/or simply didn’t know that I should) wrap the assignment statement in a simple_stmt with a newline afterwards.  But after adding a few test cases (several, actually), it turns out that the fixer wasn’t really doing the language feature much justice: it indiscriminately threw out anything in parentheses (and the parentheses themselves) after the name in the @decorator.

*sigh*

June 21, 2010

Week of code hunting starts tomorrow

Filed under: 3to2,GSoC 2010,Google Summer of Code,Personal,Work — AirBreather @ 12:21 pm

I’m going to resolve my phone problem today and then start hunting for code for 3to2 tomorrow.  Sorry about the big delay period, I’ve just been trying to keep my mind off of my issues.

June 17, 2010

Lost my phone…

Filed under: Personal,Work — AirBreather @ 12:35 pm

So, I lost my Nexus One about a week ago, and I’ve been stressing out about it really bad.  After tearing apart my house only to find out that it’s not here, I just have to assume that it’s gone.  I haven’t been able to sleep right or think straight since.

I only had it for less than a month…

June 15, 2010

3to2 0.1 Released

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 2:13 pm

I think I’ve been a little too cautious about version naming.  The “beta” tag is rather unnecessary at this point.  I have rolled in a couple of changes and released the first non-alpha, non-beta version.

I wanted to do this before I started with bug hunting to emphasize the fact that lib3to2 is usable, though incomplete.

2.7 version (pypi)
3.1 version (pypi)

A Week of Code Hunting

Filed under: 3to2,GSoC 2010,Google Summer of Code,Work — AirBreather @ 12:11 pm

Today, I start hunting down native Python 3 code to test out lib3to2.  It’s quite a bit earlier than the midterm evaluation, which was my target date to start this, but I don’t think that anything else I could do in the meantime would have a better impact than this.

For the next week, I will be searching for Python 3 code, running 3to2 on it and testing both versions to try and find as many lib3to2 bugs as possible.  Unless the fix is obvious and quick, each bug will go into the tracker and a test case will be written.  This accomplishes a few things:

  • Most obviously, it seems like the best way to find lib3to2 bugs, including failure to warn when a fix is not made.
  • Filling up the tracker seems to me like the best way to document what works and what does not.
  • Less subtly, this will help figure out the popularity of certain Python idioms that are prohibitively difficult to refactor with lib3to2, such as “from urllib import request”.  If it seems like every single large package uses such an idiom, it might be worth it to re-evaluate the decision not to refactor that.

As an aside, I consider anything not fixed that emits a proper, descriptive message not to be a lib3to2 bug.  If a fix would be possible within the framework of the lib2to3 API, then it could be considered for an “enhancement” entry on the tracker.  I’ve probably written that before, but it is relevant here again.

I’ll start with the Python 3 standard library, then work my way to PyPI, then I’ll do some Google Code Searching.

Older Posts »

Powered by WordPress