On 06/14/2014 11:17 PM, Andreas Herrmann wrote: > Hi, > > I've created two new nix-expressions, that I need to use the Pandas package.
Great. Disclaimer: I'm not a person ‘in power’ of nixpkgs and simply speak from experience. > * PyTables is a python library for HDF5 storage. It's a different approach > than h5py in that it is not a pythonic wrapper of the C library, but rather > implements relational db alike features. Pandas depends on it to read/write > HDF5 files. > http://www.pytables.org/moin > > * numexpr speeds up numpy ndarray expressions. PyTables depends on it. > https://github.com/pydata/numexpr > > However, I have a few questions before I go ahead and send a pull-request. > > A) Is there some kind of test suite that I need to run on the expressions > before I can send a pull request? (I can build and use them...) Simply make sure it builds and runs on top of the current master. For Python, check multiple Python versions. nix-build can help you build the packages. > B) Which branch should I send the pull-request to? Is master fine? master is fine. > C1) Both packages have a test-suite. However, it's not integrated into ` > setup.py`. I managed to get it running within the nix build process anyway. > The corresponding `checkPhase` is attached below. Is that an acceptable way > of doing this, or should I just set `doCheck = false;`? If it has a test-suite then I see no reason not to include it. Make sure that when tests actually do fail, this is caught as a failure rather than accepted anyway. Make a test fail and see if the whole thing does. > C2) The test-suite of pytables takes quite some time and has a number of > failures of the "not-implemented" type. Is it worth including that > test-suite or should I just leave that one out? I would include any steps necessary to run the tests but after ensuring that the failures aren't NixOS/nix specific, I'd set doCheck = false: this makes it easier for you or someone else to turn on the tests on any future, fixed versions. Make sure to let the maintainer know that there are failing tests. > D1) Pandas works without pytables. However, without it, it cannot > import/export hdf5 archives. Should I add PyTables as a dependency to > Pandas, or should every user individually add both to his environment if he > needs both? Or is there a way to make it an optional dependency? Optional dependencies are possible but I am unsure how they are done for Python packages. While I don't know how to specify such optional dependencies in python-packages.nix, you can simply create a nix-expression outside of it. See pkgs/games/anki/default.nix for an example of a Python package with optional dependencies. Provide a sensible default because only the default way will be built by Hydra. If you need Hydra to build the package in more ways then you should make two separate entries in all-packages.nix with the different flag setups but if there's only one common case then one should suffice. > D2) The latest release of Pandas is 0.14.0, the nix-pkgs version is 0.12.0. > Should I use this opportunity to bump that version number, or should this > go through a different channel? I would advise you to bump the Pandas version while you're working around it. > I've read the contributing guides on the wiki (at least those that I could > find). I learned a lot from them, but the above questions remained. > > Best, > > Andreas > > > The numexpr `checkPhase` within a call to `buildPythonPackage`: > ------------------------------------------------------------------------------------------ > > # Run the test suite. > # It requires the build path to be in the python module search path. > checkPhase = '' > ${python}/bin/${python.executable} <<EOF > import sysconfig > import sys > import os > f = "lib.{platform}-{version[0]}.{version[1]}" > lib = f.format(platform=sysconfig.get_platform(), > version=sys.version_info) > build = os.path.join(os.getcwd(), 'build', lib) > sys.path.insert(0, build) > import numexpr > numexpr.test() > EOF > ''; > > > > _______________________________________________ > nix-dev mailing list > [email protected] > http://lists.science.uu.nl/mailman/listinfo/nix-dev > I hope that somehow helps. If anything is incorrect, I'm sure someone will correct me. -- Mateusz K. _______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
