1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestrunner
5, pytest
6, psutil
7, setuptools_scm
8, pkgconfig
9, isPy3k
10, future
11}:
12
13buildPythonPackage rec {
14 pname = "python-lz4";
15 version = "2.1.2";
16
17 # get full repository inorder to run tests
18 src = fetchFromGitHub {
19 owner = pname;
20 repo = pname;
21 rev = "v${version}";
22 sha256 = "1kzzdfkrq9nnlh0wssa6ccncvv0sk4wmhivhgyndjxz6d6przl5d";
23 };
24
25 buildInputs = [ setuptools_scm pkgconfig pytestrunner ];
26 checkInputs = [ pytest psutil ];
27 propagatedBuildInputs = lib.optionals (!isPy3k) [ future ];
28
29 # give a hint to setuptools_scm on package version
30 preBuild = ''
31 export SETUPTOOLS_SCM_PRETEND_VERSION="v${version}"
32 '';
33
34 meta = {
35 description = "LZ4 Bindings for Python";
36 homepage = https://github.com/python-lz4/python-lz4;
37 license = lib.licenses.bsd3;
38 maintainers = with lib.maintainers; [ costrouc ];
39 };
40}