[Nix-dev] Re: Python 3

Marc Weber marco-oweber at gmx.de
Fri Feb 20 12:23:48 CET 2009


On Fri, Feb 20, 2009 at 11:26:47AM +0100, Peter Simons wrote:
> Hi Marc,
> 
> did you read my last posting? I would love to know what you think about
> the dependency handling approach I described in January [1]; here is the
> relevant snippet for your convenience:
> 
>  >
>  >  (b) Patch libA to extend "sys.path" as required before trying to import
>  >      libB. It's not pretty -- particularly if libA consists of a large
>  >      number of individual files --, but it does solve the problem and
>  >      requires no user action whatsoever.

Than we do have implicit imports. 
Nicolas Pierron told us that he'd like to do
  $ nix-env -i python python-lib-A python-lib-C # I don't want B
which would be impossible.

>  >  (c) Have libA create a file $out/etc/profile.d/libA.sh that sets
>  >      PYTHONPATH to include libB. This solution is rather non-intrusive
>  >      and lightweight, but it does require the user to source those
>  >      profiles to ensure that her environment is set up correctly.

And I'm not sure wether you got the difference between PYTHONPATH
(unsatisfactory) and NIX_PYTHON_SITES (which does include the .pth files
as well).

Where is the difference making libA "import" libB compared to the script
doing this by setting NIX_PYTHON_SITES? Using the environment variable
Nicolas could be satisfied as well. This way you can still omit some
libraries.. 

I don't mind. Implicit imports would be ok to me cause I only care about
installing things which should work then.

Marc



More information about the nix-dev mailing list