[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 09:45:23 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2889





------- Comment #3 from biopython-bugzilla at maubp.freeserve.co.uk  2009-07-29 05:45 EST -------
(In reply to comment #2)
> > (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
> http://mail.python.org/pipermail/distutils-sig/2009-July/012832.html
> (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:

The official way to install Biopython is "python setup.py install"
(i.e. using distutils). We don't do anything special to support
setuptools - but it seems to work.

Unfortunately, using "extras_require" or "install_requires" to make
setuptools happy causes ugly UserWarning messages from distutils.

> >> 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 unsophisticated).

The yes/no prompt using raw_input is for solely for installing without
NumPy (which is still useful, but only a subset of the full Biopython),
and is only shown if NumPy is not installed. This is a compile time
dependency for parts of Biopython.

I've updated CVS and now setup.py will abort if NumPy is not installed
and we don't appear to be running in a real terminal (based on your
suggestion).

Could you test this please?

Thanks

Peter


-- 
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