[Nix-dev] Re: Python packages in peril

Eelco Dolstra e.dolstra at tudelft.nl
Tue Apr 20 10:56:32 CEST 2010


Hi,

On 04/20/2010 01:26 AM, Marc Weber wrote:

> So python-packages.nix was fine. You choose which python-2.x version to
> pass to that file.
> But there have been many other python packages laying around in
> all-packages.nix.

I agree that this is a problem, but the best solution is to consolidate 
them into python-packages.nix using buildPythonPackage.  (If they're 
very large, it may be appropriate to put them in a separate Nix 
expression imported from python-packages.nix, just as we do in 
perl-packages.nix.)

And as Ludovic said, large refactorings like this should really be 
discussed beforehand.

> Nevertheless there may be some packages which are known to build with
> python-2.{4,5,6} only.
>
> That's why I added a attr set which removes those packages which are
> known to not building:
>
>    b = builtins.removeAttrs allPythonPackages
>            ([ "setuptoolsTrial"
>               "simplejson"
>             ]
>             # these packages don't build with specific python versions..
>             ++ (pkgs.lib.optionals (python.libPrefix == "python2.6") [])
>             ++ (pkgs.lib.optionals (python.libPrefix == "python2.5")
>               ["pycairo" "pygtk" "pyGtkGlade" "rhpl" "pygobject" "pythonSexy"])
>            );

I think these tests, if you want them, should be in the package in 
question, e.g., by having some "assert" check in pycairo.

> That's why I introduced yet another style here. I hope it is easy to
> understand though.

Given the above I don't think this style is needed.

> Anyway I added a new attr called "all". So you can test that all python
> packages build easily:
>
> nix-build -A python25Packages.all
> nix-build -A python26Packages.all

The "all" attribute seems unnecessary, since you can also do "nix-build 
-A pythonPackages".

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list