[Biopython-dev] [Bug 2889] setup.py reads stdin even when stdin is not a terminal

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Wed Jul 29 08:42:25 UTC 2009


------- Comment #2 from sridhar.ratna at gmail.com  2009-07-29 04:42 EST -------
> ------- Comment #1 from biopython-bugzilla at maubp.freeserve.co.uk  2009-07-29 03:46 EST -------
> (In reply to comment #0)
>> setup.py files are *not* meant be using raw_input and other funky things
>> that interferes with build automation.
> Have you got a reference for that? I can see why it might have a problem,
> but there is probably official guidance for this kind of thing.

Ok, I'll ease up on my assertions .. what I meant was it is a good
practice to keep the script execution simple. See
(last paragraph)

>> Please remove the use of raw_input() .. or, at least, use raw_input() only
>> when stdin is a real terminal ("if sys.stdout.isatty()").
> That makes sense. But what would you do if this is not the case?

Since your package already makes use of setuptools, I suggest you to
make use of the 'extras' features in setuptools:


If Foo depends on your package .. but also requires the numpy
component, then Foo would depend upon "biopython[numpy]". Zope
namespace packages makes use of this feature extensively (eg:

>> This way you could allow your package to built via automated build tools.
> What tool has a problem? All the Linux packagers manage fine.

PyPM (ActiveState's Python Package Manager .. analogous to PPM for
Perl) is the tool that has the problem with such packages .. the
resolution being to kill the build process that takes more than X
number of minutes (raw_input() implies infinite execution time for no
stdin). This has the unfortunate consequence of such packages becoming
not part of the repository.

Even if this bug is not fixed, we could patch the setup.py - but
ideally I prefer this to be done in the project itself (to keep things

Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Biopython-dev mailing list