@@ -0,0 +1,40 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, pytestrunner
5+, pytest
6+, psutil
7+, setuptools_scm
8+, pkgconfig
9+, isPy3k
10+, future
11+}:
12+
13+buildPythonPackage rec {
14+ pname = "python-lz4";
15+ version = "2.1.0";
16+
17+ # get full repository inorder to run tests
18+ src = fetchFromGitHub {
19+ owner = pname;
20+ repo = pname;
21+ rev = "v${version}";
22+ sha256 = "1vjfplj37jcw1mf8l810dv76dx0raia3ylgyfy7sfsb3g17brjq6";
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.bsd0;
38+ maintainers = with lib.maintainers; [ costrouc ];
39+ };
40+}