how do you prevent distutils from downloading and building packages without consent?

John Machin sjmachin at lexicon.net
Thu Mar 26 07:34:58 EDT 2009


On Mar 26, 9:59 pm, lkcl <luke.leigh... at googlemail.com> wrote:
> folks, hi,
>
> a number of people using pyjamas are not only encountering
> difficulties with setup.py endeavouring to download and install
> "setuptools" but also they are ... the best word to use is
> unfortunately "offended" - by the fact that distutils, in its default
> configuration, downloads and even _compiles_ its dependencies -
> *without consent*.

distutils is *not* involved.

Here are all of the imports in your setup.py:

import glob
from setuptools import setup, find_packages
from setuptools.command import test
from setuptools.command.install import install
import sys
import os
from pprint import pprint

A distutils setup.py will be an elaboration on this example from the
manual:

from distutils.core import setup
setup(name='foo',
      version='1.0',
      py_modules=['foo'],
      )

See that "from distutils.core import setup"? See anything like that in
your setup.py?

Whatever is happening, don't blame distutils -- it's absolutely
nothing to do with distutils. *You* are using a setup.py that calls
setuptools, which is a quite different distribution method. Have you
read the setuptools documentation? Didn't you *test* your setup.py
before making it available to the world?

>
> a copy of the setup.py can be found here:http://pyjamas.svn.sourceforge.net/viewvc/pyjamas/trunk/setup.py
>
> this alarming situation has shown to occur on windows, ubuntu and
> debian.  personally, i used setup.py to install pyjamas on a debian
> system: as i happened not to have python-setuptools installed, i was
> alarmed to find that setup.py, thanks to distutils, was not only
> downloading but also attempting to _compile_ setuptools.  fortunately,
> the compile actually failed.

What is so gut-wrenchingly awful about "compile" that you must
underline its every occurrence?

>
> windows users have also reported similar failures (presumably because
> the do not have a suitable build environment, involving downloading
> and installing a proprietary c compiler) and have also expressed their
> displeasure at not being consulted as to which bits of software are
> going to get thrown onto their system without their permission.
>
> so it should be fairly clear as to why it is unacceptable for this to
> occur.
>
> the question is: how can it be stopped?  what option, in distutils
> "terminology", tells distutils "please simply tells users that a
> package is missing, providing them with sufficient information such
> that they can rectify the missing dependency in a manner which is
> satisfactory _to them_?

Try reading the *setuptools* documentation.

HTH,
John



More information about the Python-list mailing list