[pony-build] Making virtualenv Fail

Rosangela Canino-Koning rosiec at voidptr.net
Wed Feb 10 08:25:07 PST 2010


Backing up, how much of a failure do you want? Do you want this thing to
messily grind to a halt, or do you want it to try to deal with the error
somewhat gracefully?

If pip failing to install a dependency is a massive deal-breaker for the
whole system, which, further, you never really expect to happen, but you
don't want it to fail silently, use an assert.

If pip failing to install a dependency is a rare error, but you need to
clean up after yourself at a higher level before shutting down, then throw
an exception, and catch it upstream.

Finally, if pip failing is an expected part of the program flow, and there
are ways to gracefully handle the error, and continue processing, then check
pip's return status (or catch it if it's an exception), do whatever, and
continue processing.

Any of these strategies can be implemented with either pip returning a
status code, or with pip throwing an exception. It's what you do with it
that really matters.

-rose

On Wed, Feb 10, 2010 at 11:14 AM, C. Titus Brown <ctb at msu.edu> wrote:

> subprocess returncode/status code == 0 => success
>
> On Wed, Feb 10, 2010 at 11:13:20AM -0500, Rosangela Canino-Koning wrote:
> > Asserts are typically the preferred method for this. What kind of error
> does
> > pip return (or throw?) if it fails to install?
> >
> > -rose
> >
> > On Wed, Feb 10, 2010 at 10:50 AM, Max Laite <mlaite at gmail.com> wrote:
> >
> > > I been thinking on some stuff to make virtualenv fail if pip can not
> > > install a dep. I have a few ideas, but the easiest would be to use a
> simple
> > > try block. I wanted to pass it by you guys to see if I am missing
> something
> > > in my thought process behind this.
> > >
> > > The other way was to catch the output from pip and parse for failed or
> > > something like that.
> > >
> > > Max
> > >
> > > _______________________________________________
> > > pony-build mailing list
> > > pony-build at lists.idyll.org
> > > http://lists.idyll.org/listinfo/pony-build
> > >
> > >
>
> > _______________________________________________
> > pony-build mailing list
> > pony-build at lists.idyll.org
> > http://lists.idyll.org/listinfo/pony-build
>
>
> --
> C. Titus Brown, ctb at msu.edu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/pony-build/attachments/20100210/08740b22/attachment.htm>


More information about the pony-build mailing list