1{ lib
2, buildPythonPackage
3, fetchPypi
4, isPyPy
5, snappy
6, cffi
7, nose
8}:
9
10buildPythonPackage rec {
11 pname = "python-snappy";
12 version = "0.6.0";
13
14 src = fetchPypi {
15 inherit pname version;
16 sha256 = "06l9my361ig4x5ycyrmq33q83zcdib3y2zxfxv7k7dlpyp9ri2hn";
17 };
18
19 buildInputs = [ snappy ];
20
21 propagatedBuildInputs = lib.optional isPyPy cffi;
22
23 checkInputs = [ nose ];
24
25 checkPhase = ''
26 rm -r snappy # prevent local snappy from being picked up
27 nosetests test_snappy.py
28 '' + lib.optionalString isPyPy ''
29 nosetests test_snappy_cffi.py
30 '';
31
32 meta = with lib; {
33 description = "Python library for the snappy compression library from Google";
34 homepage = "https://github.com/andrix/python-snappy";
35 license = licenses.bsd3;
36 maintainers = [ maintainers.costrouc ];
37 };
38}