2018-08-08 19:27:47 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-12-29 02:25:33 +00:00
|
|
|
, pythonOlder
|
2022-03-03 00:26:54 +00:00
|
|
|
, python
|
2021-12-29 02:25:33 +00:00
|
|
|
|
|
|
|
# native inputs
|
2019-08-01 18:41:10 +00:00
|
|
|
, pkgconfig
|
2021-06-03 10:09:11 +00:00
|
|
|
, setuptools-scm
|
2021-12-29 02:25:33 +00:00
|
|
|
|
|
|
|
# tests
|
|
|
|
, psutil
|
|
|
|
, pytestCheckHook
|
2018-08-08 19:27:47 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-lz4";
|
2022-03-02 21:42:05 +00:00
|
|
|
version = "4.0.0";
|
2021-12-29 02:25:33 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.5";
|
2018-08-08 19:27:47 +00:00
|
|
|
|
2021-12-29 02:25:33 +00:00
|
|
|
# get full repository in order to run tests
|
2018-08-08 19:27:47 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2021-12-29 02:25:33 +00:00
|
|
|
rev = "v${version}";
|
2022-03-02 21:42:05 +00:00
|
|
|
sha256 = "sha256-9gp67i2fotvFOpkaQZ82/YKnDEs3DnzXfuNCVRJg88I=";
|
2018-08-08 19:27:47 +00:00
|
|
|
};
|
|
|
|
|
2021-12-29 02:25:33 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i '/pytest-cov/d' setup.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"lz4"
|
|
|
|
"lz4.block"
|
|
|
|
"lz4.frame"
|
2022-03-03 00:26:54 +00:00
|
|
|
"lz4.stream"
|
2021-12-29 02:25:33 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
psutil
|
|
|
|
];
|
|
|
|
|
2022-03-03 00:26:54 +00:00
|
|
|
# for lz4.steam
|
|
|
|
PYLZ4_EXPERIMENTAL = true;
|
2018-08-08 19:27:47 +00:00
|
|
|
|
2022-03-03 00:26:54 +00:00
|
|
|
# prevent local lz4 directory from getting imported as it lacks native extensions
|
|
|
|
preCheck = ''
|
|
|
|
rm -r lz4
|
|
|
|
export PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH
|
2018-08-08 19:27:47 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-29 02:25:33 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "LZ4 Bindings for Python";
|
|
|
|
homepage = "https://github.com/python-lz4/python-lz4";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2018-08-08 19:27:47 +00:00
|
|
|
};
|
|
|
|
}
|