Buildout -- Software for automating application assembly

setup.py needs code from another egg to build

Reported by Martijn Faassen on 2007-04-26
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Buildout
Undecided
Unassigned

Bug Description

I've been trying to build SciPy using buildout. SciPy has a setup.py which uses distutils infrastructure provided by NumPy. SciPy won't install
without NumPy already available on the Python path as it needs it for its build infrastructure. NumPy, incidentally, itself does
work with buildout, using its own distutils logic placing it on the path through hackery.

One way to resolve this particular problem is to let the developer place an egg on the path to satisfy the import requirements of another package's setup.py. I think such an option is currently missing.

Aside: Unfortunately I keep running into packages that do setup.py hackery like this. They work outside of buildout, but fail in a buildout setup. One way to deal with this problem is to evangelize clean package constructions. It's hard to always get a response though. And some packages just *do* require quite complicated build procedures and it's hard to convince the authors to rewrite them just to please buildout users. I dream of some kind of "magic mode" for buildout that does hackery like this automatically to get an egg built "by whatever means necessary".

SciPy and numpy can be found here:

http://www.scipy.org/Download

Note that SciPy in particular has quite a few build requirements (besides numpy), so be sure to read its INSTALL.txt if you want to try it out.

On Apr 25, 2007, at 8:49 PM, Martijn Faassen wrote:

> Public bug reported:
>
> I've been trying to build SciPy using buildout. SciPy has a
> setup.py which uses distutils infrastructure provided by NumPy.
> SciPy won't install
> without NumPy already available on the Python path as it needs it
> for its build infrastructure. NumPy, incidentally, itself does
> work with buildout, using its own distutils logic placing it on the
> path through hackery.

I don't suppose SciPy uses the build_requires setup keyword.

Perhaps the custom and develop recipes should grow a setup-requires
to name distributions that must be in the working set when building a
distribution. Do you think that would address this situation?

Jim

--
Jim Fulton mailto:<email address hidden> Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org

Martijn Faassen (faassen) wrote :

On 4/26/07, Jim Fulton <email address hidden> wrote:
>
> On Apr 25, 2007, at 8:49 PM, Martijn Faassen wrote:
>
> > Public bug reported:
> >
> > I've been trying to build SciPy using buildout. SciPy has a
> > setup.py which uses distutils infrastructure provided by NumPy.
> > SciPy won't install
> > without NumPy already available on the Python path as it needs it
> > for its build infrastructure. NumPy, incidentally, itself does
> > work with buildout, using its own distutils logic placing it on the
> > path through hackery.
>
> I don't suppose SciPy uses the build_requires setup keyword.

I don't recall seeing it. Unfortunately many of these setup.py's
contain serious hackery in general...

> Perhaps the custom and develop recipes should grow a setup-requires
> to name distributions that must be in the working set when building a
> distribution. Do you think that would address this situation?

Yes, that would help in this case, I think.

Jim Fulton (jim-zope) on 2007-05-31
Changed in zc.buildout:
status: Unconfirmed → Confirmed
Craig Sawyer (csawyer-yumaed) wrote :

This would also fix a bug with getting twisted working in buildout (which requires zope.interfaces).

Thomas Schilz (thschilz) wrote :

The following workaround worked for me: Install numpy in its own part via "buildout setup" before installing scipy:

[buildout]
parts = numpy python
packages = <path to directory containing numpy-1.6.2.zip>

[numpy]
recipe = collective.recipe.cmd
cmds =
  tmpdir=`mktemp -d`
  cd $tmpdir
  unzip -x ${buildout:packages}/numpy-1.6.2.zip
  ${buildout:directory}/bin/buildout setup numpy-1.6.2 install
on_install = true
on_update = true

[python]
recipe = zc.recipe.egg
eggs = scipy
interpreter=python

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers