[Nix-dev] python packages and dependencies

Cillian de Róiste cillian.deroiste at gmail.com
Mon Jan 16 11:18:30 CET 2012


On Wed, Sep 21, 2011 at 10:09 PM, Peter Simons <simons at cryp.to> wrote:
> Hi Florian,
>
>  > buildPythonPackage happily fetches all dependency of a package defined in
>  > setup.py. The dependencies in there are not necessarily fixed to a
>  > specific version. Therefore, it's not guaranteed that one and the same
>  > nix expression produces the same derivation. How is this handled?
>
> I have noticed that, too, and I'm not about that "feature" either. I assume
> that there is a way (command-line flag) to tell 'distutils' to disable
> network access? Does anyone know how to do that?

Florian and I were discussing this again the other day and found that
there is a convenient way to do this (patch attached), by setting
allow_hosts=None in a system distutils.cfg. It's interesting that this
will not effect a virtualenv which means that someone could still use
easy_install from a virtualenv and dependencies would be resolved in
the usual way. I have tested the equivalent setup.cfg file and it has
the desired effect, but I didn't test the patch enough yet to verify
that it works as expected. Just to be clear, the builder doesn't need
to call easy_install explicitly for this setting to be applied, it is
also used when running e.g. `python setup.py test` in a package which
imports setuputils, which would otherwise download and install the
requirements.

http://packages.python.org/distribute/easy_install.html#restricting-downloads-with-allow-hosts

Cheers,
Cillian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: distutils.patch
Type: application/octet-stream
Size: 935 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20120116/809b653c/attachment.obj 


More information about the nix-dev mailing list