Sunday, February 14, 2010

We messed up dude.

So this week I started to mess around with virtualenv some more and getting it to fail if pip can not install a dependency. Some info in no particular order.....

1) VirtualenvContext is just another context for running build scripts, but in this case it gives us the advantages of virtualenv . We can run the build script in a "fresh" environment, which leads us to why we need to have the pip integration. Pip lets us install everything the application will need to build and run properly.

2) You can follow a thread I started on the pb list to discuss how we would want to go about catching any issues pip may run into during the install process. The main issues, spelling(which basically means the pkg will come back as not existing) and just the pip process failing all together. Since we run under virtualenv we have no worries about rights issues, so it would come down to some other error - which I think we can catch with an OSError, stop execution and print out whatever the error may be to the user.

3) So far I am just testing for the pkg not existing. You can see the code so far here. Right now I think it is a pretty poor way to figure it out. Basically I am parsing the output from _run_command and looking for 'not'. 'not' shows up in the error from pip saying it can not find the requested package at the 40th place.

I think I finally all so got the mkdir stuff and Git to a final state. (Though its under the close scrutiny of ctb as I write this, so who knows). I changed things here and there, the core functioning of the process did not change but rather just a little "prettying-up" of things.

No comments:

Post a Comment