[Distutils] What does it mean for Python to "bundle pip"?

Vinay Sajip vinay_sajip at yahoo.co.uk
Wed Aug 21 09:04:43 CEST 2013


Oscar Benjamin <oscar.j.benjamin <at> gmail.com> writes:

> I think that they are responsible for installing the f2py script in
> each of my Scripts directories. I never use this script and I don't
> know what numpy wants with it (my understanding is that the Fortran
> parts of numpy were all shifted over to scipy).

IIUC, if a third-party extension wants to use Fortran, the build process
converts it using f2py in to a Python-importable extension. It may be a
feature for distributions that use numpy, even if numpy doesn't use Fortran
itself.

> > 2. Tags (not in general, but AIUI numpy distribute a fancy installer that
> > decides what compiled code to use depending on whether you have certain CPU
> > features - they may want to retain that, and to do so may prefer to have
> > more fine-grained tags, which in turn may or may not be possible to
> > support). I don't think that's a critical issue though.
> 
> I guess this is what you mean:
> https://github.com/numpy/numpy/blob/master/tools/win32build/cpuid/test.c
> 
> Is there no way for them to run a post-install script when pip
> installing wheels from PyPI?

I'm not sure that would be enough. The numpy installation checks for various
features available at build time, and then writes numpy source code which is
then installed. When building and installing on the same machine, perhaps no
problem - but there could be problems when installation happens on a
different machine, since the sources written to the wheel at build time
would encode information about the build environment which may not be valid
in the installation environment.

ISTM for numpy to work with wheels, all of this logic would need to move
from build time to run time, but I don't know how pervasive the
source-writing approach is and how much work would be entailed in switching
over to run-time adaptation to the environment.

Regards,

Vinay Sajip



More information about the Distutils-SIG mailing list