nixpkgs/pkgs/development/python-modules/lz4/default.nix

69 lines
1.1 KiB
Nix
Raw Normal View History

{ lib
, buildPythonPackage
, fetchFromGitHub
2021-12-29 02:25:33 +00:00
, pythonOlder
# native inputs
, pkgconfig
, setuptools-scm
2021-12-29 02:25:33 +00:00
# tests
, psutil
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "python-lz4";
2021-12-29 02:25:33 +00:00
version = "3.1.12";
format = "setuptools";
disabled = pythonOlder "3.5";
2021-12-29 02:25:33 +00:00
# get full repository in order to run tests
src = fetchFromGitHub {
owner = pname;
repo = pname;
2021-12-29 02:25:33 +00:00
rev = "v${version}";
sha256 = "sha256-fqt9aJGqZpfbiYtU8cmm7UQaixZwbTKFBwRfR1B/qic=";
};
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"
"lz4.stream"
];
checkInputs = [
pytestCheckHook
psutil
];
# leave build directory, so the installed library gets imported
preCheck = ''
pushd tests
'';
2021-12-29 02:25:33 +00:00
postCheck = ''
popd
'';
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 ];
};
}