[BioPython] bio.pdb.mmcif does not exist

Michiel de Hoon mdehoon at c2b2.columbia.edu
Wed May 9 14:07:20 UTC 2007


Alex Lancaster wrote:
> P> The way the setup.py script prompts the user about building
> P> Bio.KDTree with a simple yes/no prompt is a simple short term
> P> solution.  I could certainly manage to make that change.
> 
> I would prefer to that it also be a command-line options so that a
> biopython build can be automated by a build system, when making RPM
> packages.  (Currently the Fedora package has to simulate the user
> typing "yes" to the Bio.KDTree question which is fragile).

I'm not too happy about adding a command-line option, so let me propose 
another solution.

A little-known secret in Python is that you can do autoconf-like 
configuration from a setup.py script. All the machinery is already there 
in Python, but unfortunately it's not well documented. However, it's 
fairly simple to use in practice -- way easier than autoconf.

What this amounts to is that before "python setup.py build", a user will 
also have to run "python setup.py config" to check if the flex library 
is present. If so, we can compile MMCIFlex during the build. If not, or 
if a user doesn't do the config step, assume that flex is not present 
and don't compile MMCIFlex.

As far as I can see, this solves the problem for the Fedora packaging. 
Furthermore, the config lets us catch potential problems with flex 
before we start compiling stuff.

A simple example of a configuration using setup.py can be found in a 
tiny statistics module I wrote a while ago. See:

http://bonsai.ims.u-tokyo.ac.jp/~mdehoon/software/python/Statistics/

in case you want to try this approach.

--Michiel.



More information about the Biopython mailing list