distutils fix

A colleague is trying to build an sdist from his svn repository.
He doesn't have any of Numeric, numarray or numpy installed and gets

    % python setup.py sdist
    Traceback (most recent call last):
      File "setup.py", line 133, in <module>
        raise RuntimeError("You must install one or more of numpy,
    Numeric, and numarray to build matplotlib")
    RuntimeError: You must install one or more of numpy, Numeric, and
    numarray to build matplotlib

We should not be checking for these dependencies when making a bdist
or sdist. Does anyone know the right distutils calls to check for the
command passed to setup.py, eg 'build', 'install', or 'sdist' ...?

Thanks,
JDH

John Hunter wrote:

A colleague is trying to build an sdist from his svn repository.
He doesn't have any of Numeric, numarray or numpy installed and gets

    % python setup.py sdist
    Traceback (most recent call last):
      File "setup.py", line 133, in <module>
        raise RuntimeError("You must install one or more of numpy,
    Numeric, and numarray to build matplotlib")
    RuntimeError: You must install one or more of numpy, Numeric, and
    numarray to build matplotlib

We should not be checking for these dependencies when making a bdist
or sdist.

Actually, I'm pretty sure we should be checking for them when making a bdist
since bdists require a build.

Does anyone know the right distutils calls to check for the
command passed to setup.py, eg 'build', 'install', or 'sdist' ...?

There aren't any reliable ways because the commands don't get processed until
setup() is called. The checks for numpy et al. happen specifically to determine
what information to pass to setup().

You could check sys.argv, but it would be at the expense of making everyone's
build processes very, very fragile. It probably wouldn't work very well, either.

···

--
Robert Kern
robert.kern@...149...

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
  -- Umberto Eco

John Hunter wrote:

A colleague is trying to build an sdist from his svn repository.
He doesn't have any of Numeric, numarray or numpy installed and gets

   % python setup.py sdist
   Traceback (most recent call last):
     File "setup.py", line 133, in <module>
       raise RuntimeError("You must install one or more of numpy,
   Numeric, and numarray to build matplotlib")
   RuntimeError: You must install one or more of numpy, Numeric, and
   numarray to build matplotlib

We should not be checking for these dependencies when making a bdist
or sdist. Does anyone know the right distutils calls to check for the
command passed to setup.py, eg 'build', 'install', or 'sdist' ...?

An alternative might be to have an appropriate MANIFEST.in file and a very simple setup_sdist.py file...